summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/InstructionSimplify.h
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-12-28 11:30:55 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-12-28 11:30:55 +0000
commitc98bd9f1a79adffe73acd337b6f7f9afa6bae078 (patch)
tree2bdf0bd7c9002f219fd0f78d6f7b3c88c01eb095 /include/llvm/Analysis/InstructionSimplify.h
parentf045df1b8b7f80e17e34c2b5639082a1d0e289ae (diff)
downloadllvm-c98bd9f1a79adffe73acd337b6f7f9afa6bae078.tar.gz
llvm-c98bd9f1a79adffe73acd337b6f7f9afa6bae078.tar.bz2
llvm-c98bd9f1a79adffe73acd337b6f7f9afa6bae078.tar.xz
Add entry points to instsimplify for simplifying calls. The entry points
are nice and decomposed so that we can simplify synthesized calls as easily as actually call instructions. The internal utility still has the same behavior, it just now operates on a more generic interface so that I can extend the set of call simplifications that instsimplify knows about. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/InstructionSimplify.h')
-rw-r--r--include/llvm/Analysis/InstructionSimplify.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/llvm/Analysis/InstructionSimplify.h b/include/llvm/Analysis/InstructionSimplify.h
index 721f0ddd2e..dd643a0469 100644
--- a/include/llvm/Analysis/InstructionSimplify.h
+++ b/include/llvm/Analysis/InstructionSimplify.h
@@ -19,6 +19,8 @@
#ifndef LLVM_ANALYSIS_INSTRUCTIONSIMPLIFY_H
#define LLVM_ANALYSIS_INSTRUCTIONSIMPLIFY_H
+#include "llvm/User.h"
+
namespace llvm {
template<typename T>
class ArrayRef;
@@ -205,6 +207,24 @@ namespace llvm {
const TargetLibraryInfo *TLI = 0,
const DominatorTree *DT = 0);
+ /// \brief Given a function and iterators over arguments, see if we can fold
+ /// the result.
+ ///
+ /// If this call could not be simplified returns null.
+ Value *SimplifyCall(Value *F, User::op_iterator ArgBegin,
+ User::op_iterator ArgEnd, const DataLayout *TD = 0,
+ const TargetLibraryInfo *TLI = 0,
+ const DominatorTree *DT = 0);
+
+ /// \brief Given a function and set of arguments, see if we can fold the
+ /// result.
+ ///
+ /// If this call could not be simplified returns null.
+ Value *SimplifyCall(Value *F, ArrayRef<Value *> Args,
+ const DataLayout *TD = 0,
+ const TargetLibraryInfo *TLI = 0,
+ const DominatorTree *DT = 0);
+
/// SimplifyInstruction - See if we can compute a simplified version of this
/// instruction. If not, this returns null.
Value *SimplifyInstruction(Instruction *I, const DataLayout *TD = 0,