[PATCH] D143786: [X86] Add `TuningPreferShiftShuffle` for when Shifts are preferable to shuffles.

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 11 09:17:08 PST 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/test/CodeGen/X86/pr57340.ll:272
 ; CHECK-NEXT:    kandw %k1, %k0, %k0
-; CHECK-NEXT:    vpshufd {{.*#+}} xmm2 = xmm1[3,3,3,3]
+; CHECK-NEXT:    vpsrldq {{.*#+}} xmm2 = xmm1[12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero
 ; CHECK-NEXT:    vpextrw $0, %xmm2, %eax
----------------
RKSimon wrote:
> Are byte shifts faster I thought they were still Port5 bound? 
Same perf/code size for byte-shift vs shuffle so figure its all the same. I guess, however, it could have a drawback because its harder to switch domains for shift than shuffle so I can update logic to only do bit-shift.

Also note this particular case actually reflects a missed optimization in `combineExtractVectorElt` because it should be just using `vpextrw` but I still haven't figured out exactly whats missing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143786/new/

https://reviews.llvm.org/D143786



More information about the llvm-commits mailing list