We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7990a7e commit adb4cfeCopy full SHA for adb4cfe
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -312,7 +312,7 @@ Instruction *InstCombinerImpl::foldCmpLoadFromIndexedGlobal(
312
DL.getTypeAllocSize(Init->getType()->getArrayElementType());
313
auto MaskIdx = [&](Value *Idx) {
314
if (!GEP->isInBounds() && llvm::countr_zero(ElementSize) != 0) {
315
- Value *Mask = ConstantInt::get(Idx->getType(), -1);
+ Value *Mask = Constant::getAllOnesValue(Idx->getType());
316
Mask = Builder.CreateLShr(Mask, llvm::countr_zero(ElementSize));
317
Idx = Builder.CreateAnd(Idx, Mask);
318
}
0 commit comments