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 8a95378 commit 7d321e7Copy full SHA for 7d321e7
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -315,7 +315,7 @@ Instruction *InstCombinerImpl::foldCmpLoadFromIndexedGlobal(
315
DL.getTypeAllocSize(Init->getType()->getArrayElementType());
316
auto MaskIdx = [&](Value *Idx) {
317
if (!GEP->isInBounds() && llvm::countr_zero(ElementSize) != 0) {
318
- Value *Mask = ConstantInt::get(Idx->getType(), -1);
+ Value *Mask = Constant::getAllOnesValue(Idx->getType());
319
Mask = Builder.CreateLShr(Mask, llvm::countr_zero(ElementSize));
320
Idx = Builder.CreateAnd(Idx, Mask);
321
}
0 commit comments