[PATCH] D127122: [InstCombine] reduce right-shift-of-left-shifted constant via demanded bits

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 09:20:35 PDT 2022


RKSimon added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:640
+        const APInt *C;
+        if (match(I->getOperand(0), m_Shl(m_APInt(C), m_Value(X))) &&
+            C->countTrailingZeros() >= ShiftAmt) {
----------------
Why limit this to (scalar) constants instead of using KnownBits::countMinTrailingZeros?


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

https://reviews.llvm.org/D127122



More information about the llvm-commits mailing list