[llvm] [SelectionDAG] Calculate KnownBits for SMIN (PR #85584)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 21:08:31 PDT 2024


================
@@ -4017,6 +4015,16 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts,
       }
     }
 
+    // For SMIN, if CstHigh is negative we know the result will be
----------------
topperc wrote:

It's possible to know the LHS has some number of sign bits without knowing whether it is positive or negative. Here's the patch that added the SMAX code https://reviews.llvm.org/D126896

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


More information about the llvm-commits mailing list