]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: refactor memclrrange for arrays and slices
authorMartin Möhrmann <moehrmann@google.com>
Mon, 30 Apr 2018 13:48:56 +0000 (15:48 +0200)
committerMartin Möhrmann <moehrmann@google.com>
Wed, 2 May 2018 04:20:25 +0000 (04:20 +0000)
commit500d79c410f8e9ad762ba318a0a4b05d0d4d1751
tree20569b24ebf43a7eb640b1b7539b5382024ffef0
parenteec8fb5ef3a60fae575f18ec05e7c21f5589f05f
cmd/compile: refactor memclrrange for arrays and slices

Rename memclrrange to signify that it does not handle
all types of range clears.

Simplify checks to detect the range clear idiom for
arrays and slices.

Add tests to verify the optimization for the slice
range clear idiom is being applied by the compiler.

Change-Id: I5c3b7c9a479699ebdb4c407fde692f30f377860c
Reviewed-on: https://go-review.googlesource.com/110477
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/range.go
test/codegen/slices.go [new file with mode: 0644]