Skip to content

Commit 3b27fce

Browse files
committed
[CGP] Use getAllOnesValue()
Split out from #80309.
1 parent 246c236 commit 3b27fce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/CodeGenPrepare.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ static bool matchUAddWithOverflowConstantEdgeCases(CmpInst *Cmp,
16431643
if (Pred == ICmpInst::ICMP_EQ && match(B, m_AllOnes()))
16441644
B = ConstantInt::get(B->getType(), 1);
16451645
else if (Pred == ICmpInst::ICMP_NE && match(B, m_ZeroInt()))
1646-
B = ConstantInt::get(B->getType(), -1);
1646+
B = Constant::getAllOnesValue(B->getType());
16471647
else
16481648
return false;
16491649

0 commit comments

Comments
 (0)