summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-07-29 03:27:33 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-07-29 03:27:33 +0000
commita926b3e71b6aad25a53713cf85a0ee3c8583d2af (patch)
treec45261a53a85de58949b8b9da8bdab8d279ca921 /llvm/lib/Analysis/ConstantFolding.cpp
parent57b94c8d6a249da464995e651e057645ad6b4c1b (diff)
downloadbcm5719-llvm-a926b3e71b6aad25a53713cf85a0ee3c8583d2af.tar.gz
bcm5719-llvm-a926b3e71b6aad25a53713cf85a0ee3c8583d2af.zip
[ConstantFolding] Remove an unused ConstantFoldInstOperands overload
No functional change is intended. llvm-svn: 277101
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index c7f656a09db..010f5d62f06 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -918,11 +918,12 @@ Constant *SymbolicallyEvaluateGEP(const GEPOperator *GEP,
/// information, due to only being passed an opcode and operands. Constant
/// folding using this function strips this information.
///
-Constant *ConstantFoldInstOperandsImpl(const Value *InstOrCE, Type *DestTy,
- unsigned Opcode,
+Constant *ConstantFoldInstOperandsImpl(const Value *InstOrCE, unsigned Opcode,
ArrayRef<Constant *> Ops,
const DataLayout &DL,
const TargetLibraryInfo *TLI) {
+ Type *DestTy = InstOrCE->getType();
+
// Handle easy binops first.
if (Instruction::isBinaryOp(Opcode))
return ConstantFoldBinaryOpOperands(Opcode, Ops[0], Ops[1], DL);
@@ -1003,8 +1004,7 @@ ConstantFoldConstantImpl(const Constant *C, const DataLayout &DL,
return ConstantFoldCompareInstOperands(CE->getPredicate(), Ops[0], Ops[1],
DL, TLI);
- return ConstantFoldInstOperandsImpl(CE, CE->getType(), CE->getOpcode(), Ops,
- DL, TLI);
+ return ConstantFoldInstOperandsImpl(CE, CE->getOpcode(), Ops, DL, TLI);
}
assert(isa<ConstantVector>(C));
@@ -1094,16 +1094,7 @@ Constant *llvm::ConstantFoldInstOperands(Instruction *I,
ArrayRef<Constant *> Ops,
const DataLayout &DL,
const TargetLibraryInfo *TLI) {
- return ConstantFoldInstOperandsImpl(I, I->getType(), I->getOpcode(), Ops, DL,
- TLI);
-}
-
-Constant *llvm::ConstantFoldInstOperands(unsigned Opcode, Type *DestTy,
- ArrayRef<Constant *> Ops,
- const DataLayout &DL,
- const TargetLibraryInfo *TLI) {
- assert(Opcode != Instruction::GetElementPtr && "Invalid for GEPs");
- return ConstantFoldInstOperandsImpl(nullptr, DestTy, Opcode, Ops, DL, TLI);
+ return ConstantFoldInstOperandsImpl(I, I->getOpcode(), Ops, DL, TLI);
}
Constant *llvm::ConstantFoldCompareInstOperands(unsigned Predicate,
OpenPOWER on IntegriCloud