Skip to content

Commit 0dfd2bf

Browse files
committed
[LTT] Directly create inbounds gep (NFCI)
We know that this gep is inbounds. Constant expression construction already infers this fact, but make it explicit.
1 parent 1ea8cae commit 0dfd2bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/IPO/LowerTypeTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ void LowerTypeTestsModule::buildBitSetsFromGlobalVariables(
879879
// Multiply by 2 to account for padding elements.
880880
Constant *CombinedGlobalIdxs[] = {ConstantInt::get(Int32Ty, 0),
881881
ConstantInt::get(Int32Ty, I * 2)};
882-
Constant *CombinedGlobalElemPtr = ConstantExpr::getGetElementPtr(
882+
Constant *CombinedGlobalElemPtr = ConstantExpr::getInBoundsGetElementPtr(
883883
NewInit->getType(), CombinedGlobal, CombinedGlobalIdxs);
884884
assert(GV->getType()->getAddressSpace() == 0);
885885
GlobalAlias *GAlias =

0 commit comments

Comments
 (0)