[llvm] Simplify Patterns (PR #102221)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 09:18:47 PDT 2024


================
@@ -3803,12 +3803,7 @@ static unsigned ComputeNumSignBitsImpl(const Value *V,
     case Instruction::SDiv: {
       const APInt *Denominator;
       // sdiv X, C -> adds log(C) sign bits.
-      if (match(U->getOperand(1), m_APInt(Denominator))) {
-
-        // Ignore non-positive denominator.
-        if (!Denominator->isStrictlyPositive())
-          break;
-
+      if (match(U->getOperand(1), m_StrictlyPositive(Denominator))) {
----------------
RKSimon wrote:

Aren't you now allowing poison values with m_StrictlyPositive whereas m_APInt didn't allow them?

https://github.com/llvm/llvm-project/pull/102221


More information about the llvm-commits mailing list