aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-11 02:08:33 +0000
committerChris Lattner <sabre@nondot.org>2009-11-11 02:08:33 +0000
commitcc4d3b25f336eef135cb7125716ecb2c1979e92e (patch)
treeb88afbddaf8e23d3ee31ed5a39ca8501b22edac3 /include
parent5606ec894ec306f6ce8ac95d61da3375b03a3bb1 (diff)
downloadexternal_llvm-cc4d3b25f336eef135cb7125716ecb2c1979e92e.zip
external_llvm-cc4d3b25f336eef135cb7125716ecb2c1979e92e.tar.gz
external_llvm-cc4d3b25f336eef135cb7125716ecb2c1979e92e.tar.bz2
stub out some LazyValueInfo interfaces, and have JumpThreading
start using them in a trivial way when -enable-jump-threading-lvi is passed. enable-jump-threading-lvi will be my playground for awhile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86789 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/LazyValueInfo.h35
1 files changed, 28 insertions, 7 deletions
diff --git a/include/llvm/Analysis/LazyValueInfo.h b/include/llvm/Analysis/LazyValueInfo.h
index 29f8180..0553e9e 100644
--- a/include/llvm/Analysis/LazyValueInfo.h
+++ b/include/llvm/Analysis/LazyValueInfo.h
@@ -18,23 +18,44 @@
#include "llvm/Pass.h"
namespace llvm {
-
+ class Constant;
+ class TargetData;
+ class Value;
+
/// LazyValueInfo - This pass computes, caches, and vends lazy value constraint
/// information.
class LazyValueInfo : public FunctionPass {
+ class TargetData *TD;
+ void *PImpl;
public:
static char ID;
- LazyValueInfo();
+ LazyValueInfo() : FunctionPass(&ID), PImpl(0) {}
+
+ /// Tristate - This is used to return yes/no/dunno results.
+ enum Tristate {
+ Unknown = -1, No = 0, Yes = 1
+ };
+
+
+ // Public query interface.
+
+
+ /// isEqual - Determine whether the specified value is known to be equal or
+ /// not-equal to the specified constant at the end of the specified block.
+ Tristate isEqual(Value *V, Constant *C, BasicBlock *BB);
+ /// getConstant - Determine whether the specified value is known to be a
+ /// constant at the end of the specified block. Return null if not.
+ Constant *getConstant(Value *V, BasicBlock *BB);
+
+
+ // Implementation boilerplate.
+
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
}
virtual void releaseMemory();
-
- virtual bool runOnFunction(Function &F) {
- // Fully lazy.
- return false;
- }
+ virtual bool runOnFunction(Function &F);
};
} // end namespace llvm