Open Validark opened 2 months ago
@llvm/issue-subscribers-backend-aarch64
Author: Niles Salter (Validark)
@llvm/issue-subscribers-backend-risc-v
Author: Niles Salter (Validark)
@llvm/issue-subscribers-backend-x86
Author: Niles Salter (Validark)
Godbolt link
This code:
Results in this emit for Zen 4:
As you can see, we hoist
not rdi
out of the loop, even though we could have usedandn
. The same situation happens to the Sifive x280 (aggressive unrolling disabled via size-optimized build option):However, on the Apple M3, it actually does make sense to hoist
mvn
out of the loop in this case, because we can doand x11, x8, x9, lsl #2
but we can't dobic x11, x8, x9, lsl #2
(I assume).Apple M3 emit: