Skip to content

Commit 7d321e7

Browse files
nikicakiramenai
authored andcommitted
[InstCombine] Use getAllOnesValue()
Split off from llvm/llvm-project#80309.
1 parent 8a95378 commit 7d321e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ Instruction *InstCombinerImpl::foldCmpLoadFromIndexedGlobal(
315315
DL.getTypeAllocSize(Init->getType()->getArrayElementType());
316316
auto MaskIdx = [&](Value *Idx) {
317317
if (!GEP->isInBounds() && llvm::countr_zero(ElementSize) != 0) {
318-
Value *Mask = ConstantInt::get(Idx->getType(), -1);
318+
Value *Mask = Constant::getAllOnesValue(Idx->getType());
319319
Mask = Builder.CreateLShr(Mask, llvm::countr_zero(ElementSize));
320320
Idx = Builder.CreateAnd(Idx, Mask);
321321
}

0 commit comments

Comments
 (0)