[PATCH] [InstCombine] Constant comparison involving "lshr exact"

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Mon Jun 2 09:01:35 PDT 2014


LGTM with two nits.

================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:2327
@@ +2326,3 @@
+
+static bool CheckShrExact(Value *Op, APInt &Quotient, const ConstantInt *CI,
+                          Value *&A) {
----------------
Start function name with a lowercase letter.


================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:2338
@@ +2337,3 @@
+  // Handle the case for lhsr.
+  else if (match(Op, m_LShr(m_ConstantInt(CI2), m_Value(A))) &&
+           (cast<BinaryOperator>(Op)->isExact())) {
----------------
No else needed after a return.

http://reviews.llvm.org/D3987






More information about the llvm-commits mailing list