summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-01-04 12:36:10 +0100
committerNikita Popov <npopov@redhat.com>2022-01-04 12:37:12 +0100
commit71b2c4a3cf5c4709fcab66194b3277a31b849c22 (patch)
treeefd99df437f17ed3143dcefeeaf903515a6c82d1
parent2a92efd0a23984c910f0ce3a6b515cc9e15ba87c (diff)
downloadllvm-71b2c4a3cf5c4709fcab66194b3277a31b849c22.tar.gz
[ConstantFolding] Remove unused ConstantFoldLoadThroughGEPConstantExpr()
This API is no longer used since bbeaf2aac678633749e7385466da10a1c0120b3b.
-rw-r--r--llvm/include/llvm/Analysis/ConstantFolding.h7
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp17
2 files changed, 0 insertions, 24 deletions
diff --git a/llvm/include/llvm/Analysis/ConstantFolding.h b/llvm/include/llvm/Analysis/ConstantFolding.h
index 45fb879f0c1f..7a68cd728f60 100644
--- a/llvm/include/llvm/Analysis/ConstantFolding.h
+++ b/llvm/include/llvm/Analysis/ConstantFolding.h
@@ -148,13 +148,6 @@ Constant *ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty, APInt Offset,
Constant *ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty,
const DataLayout &DL);
-/// ConstantFoldLoadThroughGEPConstantExpr - Given a constant and a
-/// getelementptr constantexpr, return the constant value being addressed by the
-/// constant expression, or null if something is funny and we can't decide.
-Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE,
- Type *Ty,
- const DataLayout &DL);
-
/// canConstantFoldCallTo - Return true if its even possible to fold a call to
/// the specified function.
bool canConstantFoldCallTo(const CallBase *Call, const Function *F);
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index c8ee130d6655..7f7c9a56b1b7 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -1368,23 +1368,6 @@ Constant *llvm::ConstantFoldCastOperand(unsigned Opcode, Constant *C,
}
}
-Constant *llvm::ConstantFoldLoadThroughGEPConstantExpr(Constant *C,
- ConstantExpr *CE,
- Type *Ty,
- const DataLayout &DL) {
- if (!CE->getOperand(1)->isNullValue())
- return nullptr; // Do not allow stepping over the value!
-
- // Loop over all of the operands, tracking down which value we are
- // addressing.
- for (unsigned i = 2, e = CE->getNumOperands(); i != e; ++i) {
- C = C->getAggregateElement(CE->getOperand(i));
- if (!C)
- return nullptr;
- }
- return ConstantFoldLoadThroughBitcast(C, Ty, DL);
-}
-
//===----------------------------------------------------------------------===//
// Constant Folding for Calls
//