[llvm] 3b27fce - [CGP] Use getAllOnesValue()

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


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

URL: https://github.com/llvm/llvm-project/commit/3b27fce960e965097c9d597b1bd35e8593121d25
DIFF: https://github.com/llvm/llvm-project/commit/3b27fce960e965097c9d597b1bd35e8593121d25.diff

LOG: [CGP] Use getAllOnesValue()

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

Added: 
    

Modified: 
    llvm/lib/CodeGen/CodeGenPrepare.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 22d0708f54786..1fb37fb8406ef 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -1643,7 +1643,7 @@ static bool matchUAddWithOverflowConstantEdgeCases(CmpInst *Cmp,
   if (Pred == ICmpInst::ICMP_EQ && match(B, m_AllOnes()))
     B = ConstantInt::get(B->getType(), 1);
   else if (Pred == ICmpInst::ICMP_NE && match(B, m_ZeroInt()))
-    B = ConstantInt::get(B->getType(), -1);
+    B = Constant::getAllOnesValue(B->getType());
   else
     return false;
 


        


More information about the llvm-commits mailing list