[PATCH] D59041: [SDAG][X86] Expand pow2 mulo using shifts
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 6 12:35:22 PST 2019
nikic marked 2 inline comments as done.
nikic added inline comments.
================
Comment at: llvm/test/CodeGen/X86/mulo-pow2.ll:30
-; AVX-NEXT: vpcmpeqd %xmm3, %xmm2, %xmm2
-; AVX-NEXT: vblendvps %xmm2, %xmm0, %xmm1, %xmm0
; AVX-NEXT: retq
----------------
This being optimized is a nice side-effect, but we really should have a fold for `mulo(x, 1)`.
================
Comment at: llvm/test/CodeGen/X86/mulo-pow2.ll:109
; AVX-NEXT: vpcmpeqd %xmm2, %xmm3, %xmm2
; AVX-NEXT: vblendvps %xmm2, %xmm0, %xmm1, %xmm0
; AVX-NEXT: retq
----------------
This code is generated by the `mulo(x, 2) -> addo(x, x)` fold and seems worse than what we'd get from the shift expansion. Not sure what to do about it.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59041/new/
https://reviews.llvm.org/D59041
More information about the llvm-commits
mailing list