summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/InstructionSimplify.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2017-12-27 00:16:12 +0000
committerPhilip Reames <listmail@philipreames.com>2017-12-27 00:16:12 +0000
commit7a6db4fc4f2fd0311003cfcf2f2ae55bc5fa3963 (patch)
treeedda1cac281cffd154dc3e0090d25cf020d12972 /llvm/lib/Analysis/InstructionSimplify.cpp
parent8af1e1cb784ae2a94775fcbd04ad283f8702606e (diff)
downloadbcm5719-llvm-7a6db4fc4f2fd0311003cfcf2f2ae55bc5fa3963.tar.gz
bcm5719-llvm-7a6db4fc4f2fd0311003cfcf2f2ae55bc5fa3963.zip
[NFC] Extract out a helper function for SimplifyCall(CS, Q)
This simplifies code, but the real motivation is that it lets me clean up some downstream code. llvm-svn: 321466
Diffstat (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp')
-rw-r--r--llvm/lib/Analysis/InstructionSimplify.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index fac6a917dc9..f02dce7ecf3 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -4617,6 +4617,12 @@ Value *llvm::SimplifyCall(ImmutableCallSite CS, Value *V,
return ::SimplifyCall(CS, V, Args.begin(), Args.end(), Q, RecursionLimit);
}
+Value *llvm::SimplifyCall(ImmutableCallSite ICS, const SimplifyQuery &Q) {
+ CallSite CS(const_cast<Instruction*>(ICS.getInstruction()));
+ return ::SimplifyCall(CS, CS.getCalledValue(), CS.arg_begin(), CS.arg_end(),
+ Q, RecursionLimit);
+}
+
/// See if we can compute a simplified version of this instruction.
/// If not, this returns null.
@@ -4751,8 +4757,7 @@ Value *llvm::SimplifyInstruction(Instruction *I, const SimplifyQuery &SQ,
break;
case Instruction::Call: {
CallSite CS(cast<CallInst>(I));
- Result = SimplifyCall(CS, CS.getCalledValue(), CS.arg_begin(), CS.arg_end(),
- Q);
+ Result = SimplifyCall(CS, Q);
break;
}
#define HANDLE_CAST_INST(num, opc, clas) case Instruction::opc:
OpenPOWER on IntegriCloud