[PATCH] D66057: [InstCombine] Shift amount reassociation in bittest: trunc-of-shl (PR42399)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 09:56:20 PDT 2019


spatel added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:3315-3321
+  Instruction *XShift, *MaybeTruncation, *YShift;
+  if (!match(
+          I.getOperand(0),
+          m_c_And(m_CombineAnd(m_AnyLogicalShift, m_Instruction(XShift)),
+                  m_CombineAnd(m_TruncOrSelf(m_CombineAnd(
+                                   m_AnyLogicalShift, m_Instruction(YShift))),
+                               m_Instruction(MaybeTruncation)))))
----------------
Can we make the change to use Instruction*/m_Instruction independently (ie as a pre-commit) of this patch?
(I'd be fine without requiring a weird ConstExpr test to prove the diff if that was a possibility.)


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:3372
+  // We have two shift amounts from two different shifts. The types of those
+  // shift amounts may not match. If that's the case let's bailout now..
+  if (XShAmt->getType() != YShAmt->getType())
----------------
Extra period at end.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66057





More information about the llvm-commits mailing list