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
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index fc21a14..2b577f0 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -3261,8 +3261,7 @@
if (!LI->isVolatile())
return ConstantFoldLoadFromConstPtr(ConstOps[0], Q.DL);
- return ConstantFoldInstOperands(I->getOpcode(), I->getType(), ConstOps,
- Q.DL, Q.TLI);
+ return ConstantFoldInstOperands(I, ConstOps, Q.DL, Q.TLI);
}
}