[PATCH] D39421: [InstCombine] Extracting common and-mask for shift operands of Or instruction

Lama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 21 03:28:26 PST 2017


lsaba added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2230
+  // ((V<<C3)&C1) | ((V<<C4)&C2) --> ((V&C5)<<C3) | ((V&C5)<<C4)
+  // if C5 = C1>>C3 == C2>>C4, for both logical shifts
+  //
----------------
both logical shifts (shl / lshr)


================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2300
+      Value *CommonOperand;
+      if (PreShiftMask0 == PreShiftMask1 &&
+          match(Op0, m_BinOp(m_Value(CommonOperand), m_Value())) &&
----------------
Check that it's the same logical shift


https://reviews.llvm.org/D39421





More information about the llvm-commits mailing list