Skip to content

Commit c5b5b7f

Browse files
committed
[ConstantFolding] Remove ConstantFoldLoadThroughGEPIndices() API (NFC)
The last user of this API went away in 4f5e9a2.
1 parent e03b443 commit c5b5b7f

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

llvm/include/llvm/Analysis/ConstantFolding.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,6 @@ Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE,
150150
Type *Ty,
151151
const DataLayout &DL);
152152

153-
/// ConstantFoldLoadThroughGEPIndices - Given a constant and getelementptr
154-
/// indices (with an *implied* zero pointer index that is not in the list),
155-
/// return the constant value being addressed by a virtual load, or null if
156-
/// something is funny and we can't decide.
157-
Constant *ConstantFoldLoadThroughGEPIndices(Constant *C,
158-
ArrayRef<Constant *> Indices);
159-
160153
/// canConstantFoldCallTo - Return true if its even possible to fold a call to
161154
/// the specified function.
162155
bool canConstantFoldCallTo(const CallBase *Call, const Function *F);

llvm/lib/Analysis/ConstantFolding.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,19 +1354,6 @@ Constant *llvm::ConstantFoldLoadThroughGEPConstantExpr(Constant *C,
13541354
return ConstantFoldLoadThroughBitcast(C, Ty, DL);
13551355
}
13561356

1357-
Constant *
1358-
llvm::ConstantFoldLoadThroughGEPIndices(Constant *C,
1359-
ArrayRef<Constant *> Indices) {
1360-
// Loop over all of the operands, tracking down which value we are
1361-
// addressing.
1362-
for (Constant *Index : Indices) {
1363-
C = C->getAggregateElement(Index);
1364-
if (!C)
1365-
return nullptr;
1366-
}
1367-
return C;
1368-
}
1369-
13701357
//===----------------------------------------------------------------------===//
13711358
// Constant Folding for Calls
13721359
//

0 commit comments

Comments
 (0)