Skip to content

Commit adb4cfe

Browse files
committed
[InstCombine] Use getAllOnesValue()
Split off from #80309.
1 parent 7990a7e commit adb4cfe

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
@@ -312,7 +312,7 @@ Instruction *InstCombinerImpl::foldCmpLoadFromIndexedGlobal(
312312
DL.getTypeAllocSize(Init->getType()->getArrayElementType());
313313
auto MaskIdx = [&](Value *Idx) {
314314
if (!GEP->isInBounds() && llvm::countr_zero(ElementSize) != 0) {
315-
Value *Mask = ConstantInt::get(Idx->getType(), -1);
315+
Value *Mask = Constant::getAllOnesValue(Idx->getType());
316316
Mask = Builder.CreateLShr(Mask, llvm::countr_zero(ElementSize));
317317
Idx = Builder.CreateAnd(Idx, Mask);
318318
}

0 commit comments

Comments
 (0)