Skip to content

Commit 71b2c4a

Browse files
committed
[ConstantFolding] Remove unused ConstantFoldLoadThroughGEPConstantExpr()
This API is no longer used since bbeaf2a.
1 parent 2a92efd commit 71b2c4a

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

llvm/include/llvm/Analysis/ConstantFolding.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,6 @@ Constant *ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty, APInt Offset,
148148
Constant *ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty,
149149
const DataLayout &DL);
150150

151-
/// ConstantFoldLoadThroughGEPConstantExpr - Given a constant and a
152-
/// getelementptr constantexpr, return the constant value being addressed by the
153-
/// constant expression, or null if something is funny and we can't decide.
154-
Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE,
155-
Type *Ty,
156-
const DataLayout &DL);
157-
158151
/// canConstantFoldCallTo - Return true if its even possible to fold a call to
159152
/// the specified function.
160153
bool canConstantFoldCallTo(const CallBase *Call, const Function *F);

llvm/lib/Analysis/ConstantFolding.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,23 +1368,6 @@ Constant *llvm::ConstantFoldCastOperand(unsigned Opcode, Constant *C,
13681368
}
13691369
}
13701370

1371-
Constant *llvm::ConstantFoldLoadThroughGEPConstantExpr(Constant *C,
1372-
ConstantExpr *CE,
1373-
Type *Ty,
1374-
const DataLayout &DL) {
1375-
if (!CE->getOperand(1)->isNullValue())
1376-
return nullptr; // Do not allow stepping over the value!
1377-
1378-
// Loop over all of the operands, tracking down which value we are
1379-
// addressing.
1380-
for (unsigned i = 2, e = CE->getNumOperands(); i != e; ++i) {
1381-
C = C->getAggregateElement(CE->getOperand(i));
1382-
if (!C)
1383-
return nullptr;
1384-
}
1385-
return ConstantFoldLoadThroughBitcast(C, Ty, DL);
1386-
}
1387-
13881371
//===----------------------------------------------------------------------===//
13891372
// Constant Folding for Calls
13901373
//

0 commit comments

Comments
 (0)