aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-08-12 16:28:55 +0200
committerNikita Popov <npopov@redhat.com>2024-08-12 16:37:42 +0200
commit3b27fce960e965097c9d597b1bd35e8593121d25 (patch)
treee9518be20e826ad3217538c676d639fcafbd90af /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent246c236ff9761920f5098878aba651e2112618bf (diff)
downloadllvm-3b27fce960e965097c9d597b1bd35e8593121d25.zip
llvm-3b27fce960e965097c9d597b1bd35e8593121d25.tar.gz
llvm-3b27fce960e965097c9d597b1bd35e8593121d25.tar.bz2
[CGP] Use getAllOnesValue()
Split out from https://github.com/llvm/llvm-project/pull/80309.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 22d0708..1fb37fb 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;