[PATCH] D48229: [NFC][SCEV] Add tests related to bit masking (PR37793)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 15 12:51:59 PDT 2018


lebedev.ri added inline comments.


================
Comment at: test/Analysis/ScalarEvolution/lshr-shl-differentconstmask.ll:44-45
+;
+  %tmp1 = lshr i32 %val, 6
+  %tmp2 = shl i32 %tmp1, 4
+  ret i32 %tmp2
----------------
efriedma wrote:
> lebedev.ri wrote:
> > @spatel BTW, how do we want to canonicalize it? https://rise4fun.com/Alive/mxm
> DAGCombine currently canonicalizes to srl+and.  Unless there's a compelling reason to choose something else, that seems fine.
Aha, instcombine actually transforms it so that `and` is last.
https://godbolt.org/g/3cM8D7 (at least for some masks.)
Ok, that answers it.


Repository:
  rL LLVM

https://reviews.llvm.org/D48229





More information about the llvm-commits mailing list