[llvm] 73d835c - [ConstraintElimination] Use getAllOnesValue()

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 07:37:58 PDT 2024


Author: Nikita Popov
Date: 2024-08-12T16:37:42+02:00
New Revision: 73d835cceca0638b7080ecf310594398e50e5206

URL: https://github.com/llvm/llvm-project/commit/73d835cceca0638b7080ecf310594398e50e5206
DIFF: https://github.com/llvm/llvm-project/commit/73d835cceca0638b7080ecf310594398e50e5206.diff

LOG: [ConstraintElimination] Use getAllOnesValue()

Split out from https://github.com/llvm/llvm-project/pull/80309.

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/ConstraintElimination.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
index c31173879af1e..84ccf06d16d5e 100644
--- a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
@@ -875,7 +875,7 @@ void ConstraintInfo::transferToOtherSystem(
       addFact(CmpInst::ICMP_ULT, A, B, NumIn, NumOut, DFSInStack);
     break;
   case CmpInst::ICMP_SGT: {
-    if (doesHold(CmpInst::ICMP_SGE, B, ConstantInt::get(B->getType(), -1)))
+    if (doesHold(CmpInst::ICMP_SGE, B, Constant::getAllOnesValue(B->getType())))
       addFact(CmpInst::ICMP_UGE, A, ConstantInt::get(B->getType(), 0), NumIn,
               NumOut, DFSInStack);
     if (IsKnownNonNegative(B))


        


More information about the llvm-commits mailing list