package p
func f(b []byte, x *[8]byte) {
_ = b[8]
copy(b, x[:])
}
This should compile down to a pair of MOVQs, one to load from x and one to write to b. It doesn't; it still contains a call to runtime.memmove. From a quick glance at ssa.html, the problem is that the lowering of runtime.memmove to Move happens during generic.rules, but we haven't detected that the size of the memmove is a constant until after lowering.
To fix this, we could either improve the analysis in the generic stages or add arch-specific runtime.memmove-to-Move lowering.
cc @randall77 @dr2chase @martisch @mundaym
This should compile down to a pair of MOVQs, one to load from x and one to write to b. It doesn't; it still contains a call to runtime.memmove. From a quick glance at ssa.html, the problem is that the lowering of runtime.memmove to Move happens during generic.rules, but we haven't detected that the size of the memmove is a constant until after lowering.
To fix this, we could either improve the analysis in the generic stages or add arch-specific runtime.memmove-to-Move lowering.
cc @randall77 @dr2chase @martisch @mundaym