Skip to content

Commit fba84ec

Browse files
committed
[WPD] Directly create geteleementptr inbounds (NFCI)
We know that this GEP is inbounds, so make it explicit. NFCI because constant expression construction already infers this.
1 parent 24ddce6 commit fba84ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,7 @@ void DevirtModule::rebuildGlobal(VTableBits &B) {
19271927
// element (the original initializer).
19281928
auto Alias = GlobalAlias::create(
19291929
B.GV->getInitializer()->getType(), 0, B.GV->getLinkage(), "",
1930-
ConstantExpr::getGetElementPtr(
1930+
ConstantExpr::getInBoundsGetElementPtr(
19311931
NewInit->getType(), NewGV,
19321932
ArrayRef<Constant *>{ConstantInt::get(Int32Ty, 0),
19331933
ConstantInt::get(Int32Ty, 1)}),

0 commit comments

Comments
 (0)