15 #ifndef LLVM_ANALYSIS_SPARSEPROPAGATION_H
16 #define LLVM_ANALYSIS_SPARSEPROPAGATION_H
35 template<
typename T>
class SmallVectorImpl;
48 LatticeVal UndefVal, OverdefinedVal, UntrackedVal;
53 OverdefinedVal = overdefinedVal;
54 UntrackedVal = untrackedVal;
125 std::vector<Instruction*> InstWorkList;
127 std::vector<BasicBlock*> BBWorkList;
131 typedef std::pair<BasicBlock*,BasicBlock*> Edge;
132 std::set<Edge> KnownFeasibleEdges;
138 : LatticeFunc(Lattice) {}
154 return I != ValueState.end() ? I->second : LatticeFunc->
getUntrackedVal();
171 bool AggressiveUndef =
false);
177 return BBExecutable.count(BB);
196 bool AggressiveUndef);
206 #endif // LLVM_ANALYSIS_SPARSEPROPAGATION_H
LatticeVal getOrInitValueState(Value *V)
getOrInitValueState - Return the LatticeVal object that corresponds to the value, initializing the va...
LLVM Argument representation.
void Solve(Function &F)
Solve - Solve for constants and executable blocks.
LatticeVal getUndefVal() const
virtual LatticeVal ComputeInstructionState(Instruction &I, SparseSolver &SS)
ComputeInstructionState - Given an instruction and a vector of its operand values, compute the result value of the instruction.
bool isEdgeFeasible(BasicBlock *From, BasicBlock *To, bool AggressiveUndef=false)
isEdgeFeasible - Return true if the control flow edge from the 'From' basic block to the 'To' basic b...
bool isBlockExecutable(BasicBlock *BB) const
isBlockExecutable - Return true if there are any known feasible edges into the basic block...
virtual bool IsSpecialCasedPHI(PHINode *PN)
IsSpecialCasedPHI - Given a PHI node, determine whether this PHI node is one that the we want to hand...
virtual bool IsUntrackedValue(Value *V)
IsUntrackedValue - If the specified Value is something that is obviously uninteresting to the analysi...
virtual LatticeVal ComputeConstant(Constant *C)
ComputeConstant - Given a constant value, compute and return a lattice value corresponding to the spe...
virtual ~AbstractLatticeFunction()
SparseSolver(AbstractLatticeFunction *Lattice)
LatticeVal getUntrackedVal() const
Subclasses of this class are all able to terminate a basic block.
LLVM Basic Block Representation.
This is an important base class in LLVM.
LatticeVal getLatticeState(Value *V) const
getLatticeState - Return the LatticeVal object that corresponds to the value.
virtual Constant * GetConstant(LatticeVal LV, Value *Val, SparseSolver &SS)
GetConstant - If the specified lattice value is representable as an LLVM constant value...
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
virtual LatticeVal ComputeArgument(Argument *I)
ComputeArgument - Given a formal argument value, compute and return a lattice value corresponding to ...
AbstractLatticeFunction(LatticeVal undefVal, LatticeVal overdefinedVal, LatticeVal untrackedVal)
SparseSolver - This class is a general purpose solver for Sparse Conditional Propagation with a progr...
AbstractLatticeFunction - This class is implemented by the dataflow instance to specify what the latt...
void Print(Function &F, raw_ostream &OS) const
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
virtual void PrintValue(LatticeVal V, raw_ostream &OS)
PrintValue - Render the specified lattice value to the specified stream.
virtual LatticeVal MergeValues(LatticeVal X, LatticeVal Y)
MergeValues - Compute and return the merge of the two specified lattice values.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
LatticeVal getOverdefinedVal() const