[PATCH] D34207: [IndVarSimplify] Add AShr exact flags using induction variables ranges.

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 3 13:52:17 PDT 2017


sanjoy accepted this revision.
sanjoy added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/Transforms/Utils/SimplifyIndVar.cpp:33
 using namespace llvm;
+using namespace llvm::PatternMatch;
 
----------------
Don't open this namespace globally -- just open it in the function you're using it in.


================
Comment at: lib/Transforms/Utils/SimplifyIndVar.cpp:539
+      if (match(U,
+                m_AShr(m_Shl(m_Value(), m_Specific(IVOperand)), m_APInt(C))) ||
+          match(U,
----------------
The name and documentation of this function is now out of sync.  I'd instead just split out a separate `strengthenRightShift`, and put that logic in there.



https://reviews.llvm.org/D34207





More information about the llvm-commits mailing list