aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorManuel Jacob <me@manueljacob.de>2016-01-21 06:33:22 +0000
committerManuel Jacob <me@manueljacob.de>2016-01-21 06:33:22 +0000
commite902459c4b3e5dbe62ff31a52c2203cb4e89f338 (patch)
tree928864bcaac664d01cc092a8dff0dc8653e65911 /llvm/lib/Analysis/InlineCost.cpp
parent925d029461972b44eec4a69a61014b7646a52f3b (diff)
downloadllvm-e902459c4b3e5dbe62ff31a52c2203cb4e89f338.zip
llvm-e902459c4b3e5dbe62ff31a52c2203cb4e89f338.tar.gz
llvm-e902459c4b3e5dbe62ff31a52c2203cb4e89f338.tar.bz2
Change ConstantFoldInstOperands to take Instruction instead of opcode and type. NFC.
Summary: The previous form, taking opcode and type, is moved to an internal helper and the new form, taking an instruction, is a wrapper around this helper. Although this is a slight cleanup on its own, the main motivation is to refactor the constant folding API to ease migration to opaque pointers. This will be follow-up work. Reviewers: eddyb Subscribers: dblaikie, llvm-commits Differential Revision: http://reviews.llvm.org/D16383 llvm-svn: 258391
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 2b9e06e..32e8e27 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -533,8 +533,7 @@ bool CallAnalyzer::visitUnaryInstruction(UnaryInstruction &I) {
COp = SimplifiedValues.lookup(Operand);
if (COp) {
const DataLayout &DL = F.getParent()->getDataLayout();
- if (Constant *C = ConstantFoldInstOperands(I.getOpcode(), I.getType(),
- COp, DL)) {
+ if (Constant *C = ConstantFoldInstOperands(&I, COp, DL)) {
SimplifiedValues[&I] = C;
return true;
}