aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop-unroll.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-03-19 18:42:43 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-03-19 18:42:43 +0000
commitea5ac5a69b4b474bb221051e705f98d8599253fa (patch)
tree96913ddcd86133f8a48bb74399326f954e503841 /gcc/loop-unroll.c
parente0748030863e158ced48802ea42b27e5ec26995f (diff)
downloadgcc-ea5ac5a69b4b474bb221051e705f98d8599253fa.zip
gcc-ea5ac5a69b4b474bb221051e705f98d8599253fa.tar.gz
gcc-ea5ac5a69b4b474bb221051e705f98d8599253fa.tar.bz2
compiler,runtime: pass old slice's ptr/len/cap by value to growslice
In the C calling convention, on AMD64, and probably a number of other architectures, a 3-word struct argument is passed on stack. This is less efficient than passing in three registers. Further, this may affect the code generation in other part of the program, even if the function is not actually called. Slices are common in Go and append is a common slice operation, which calls growslice in the growing path. To improve the code generation, pass the slice header's three fields as separate values, instead of a struct, to growslice. The drawback is that this makes the runtime implementation slightly diverges from the gc runtime. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/168277 From-SVN: r269811
Diffstat (limited to 'gcc/loop-unroll.c')
0 files changed, 0 insertions, 0 deletions