summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/InstructionSimplify.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-10 01:08:51 +0000
committerChris Lattner <sabre@nondot.org>2009-11-10 01:08:51 +0000
commite34537856a544c83513e390ac9552a8bc3823346 (patch)
tree22c3def24ccc951dc07bb42f4eff7ed067705530 /include/llvm/Analysis/InstructionSimplify.h
parent81cf4325698b48b02eddab921ac333c7f25005c3 (diff)
downloadllvm-e34537856a544c83513e390ac9552a8bc3823346.tar.gz
llvm-e34537856a544c83513e390ac9552a8bc3823346.tar.bz2
llvm-e34537856a544c83513e390ac9552a8bc3823346.tar.xz
add a new SimplifyInstruction API, which is like ConstantFoldInstruction,
except that the result may not be a constant. Switch jump threading to use it so that it gets things like (X & 0) -> 0, which occur when phi preds are deleted and the remaining phi pred was a zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86637 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/InstructionSimplify.h')
-rw-r--r--include/llvm/Analysis/InstructionSimplify.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/Analysis/InstructionSimplify.h b/include/llvm/Analysis/InstructionSimplify.h
index 2398cf694f..bb5c811fe2 100644
--- a/include/llvm/Analysis/InstructionSimplify.h
+++ b/include/llvm/Analysis/InstructionSimplify.h
@@ -17,10 +17,10 @@
#define LLVM_ANALYSIS_INSTRUCTIONSIMPLIFY_H
namespace llvm {
+ class Instruction;
class Value;
class TargetData;
-
/// SimplifyAndInst - Given operands for an And, see if we can
/// fold the result. If not, this returns null.
Value *SimplifyAndInst(Value *LHS, Value *RHS,
@@ -55,6 +55,10 @@ namespace llvm {
Value *SimplifyBinOp(unsigned Opcode, Value *LHS, Value *RHS,
const TargetData *TD = 0);
+ /// SimplifyInstruction - See if we can compute a simplified version of this
+ /// instruction. If not, this returns null.
+ Value *SimplifyInstruction(Instruction *I, const TargetData *TD = 0);
+
} // end namespace llvm
#endif