1 //===- LazyValueInfo.h - Value constraint analysis --------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the interface for lazy computation of value constraint
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_ANALYSIS_LIVEVALUES_H
16 #define LLVM_ANALYSIS_LIVEVALUES_H
18 #include "llvm/Pass.h"
25 /// LazyValueInfo - This pass computes, caches, and vends lazy value constraint
27 class LazyValueInfo : public FunctionPass {
32 LazyValueInfo() : FunctionPass(&ID), PImpl(0) {}
34 /// Tristate - This is used to return yes/no/dunno results.
36 Unknown = -1, No = 0, Yes = 1
40 // Public query interface.
43 /// isEqual - Determine whether the specified value is known to be equal or
44 /// not-equal to the specified constant at the end of the specified block.
45 Tristate isEqual(Value *V, Constant *C, BasicBlock *BB);
47 /// getConstant - Determine whether the specified value is known to be a
48 /// constant at the end of the specified block. Return null if not.
49 Constant *getConstant(Value *V, BasicBlock *BB);
52 // Implementation boilerplate.
54 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
57 virtual void releaseMemory();
58 virtual bool runOnFunction(Function &F);
61 } // end namespace llvm