[PATCH] D62871: [Codegen] (X & (C l>>/<< Y)) ==/!= 0 --> ((X <</l>> Y) & C) ==/!= 0 fold

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 07:32:08 PDT 2019


lebedev.ri added inline comments.


================
Comment at: test/CodeGen/X86/hoist-and-by-const-from-shl-in-eqcmp-zero.ll:740
+; X64-NEXT:    pcmpeqd %xmm3, %xmm2
+; X64-NEXT:    movdqa %xmm2, %xmm0
 ; X64-NEXT:    retq
----------------
lebedev.ri wrote:
> lebedev.ri wrote:
> > RKSimon wrote:
> > > please can you run this through llvm-mca to compare perf?
> > While this isn't what you asked, i can tell you right away that both variants are very far from optimal:
> > https://godbolt.org/z/6dKBNR
> Hm, i was looking at that wrong, of course that isn't identical,
> because those sse/sse2 shifts all shift all elements by the same amount.
> 
> mca: https://godbolt.org/z/PQrkhj
> (i did not ensure strictly sequential execution though)
It's interesting to note how, much like aarch64, these vector changes are symmetrical.
`(X & (C << Y)) ==/!= 0` is results in best x86 pre-avx2 codegen
Should i just tune the TLI x86 hook?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62871





More information about the llvm-commits mailing list