15 #ifndef LLVM_TRANSFORMS_UTILS_BASICBLOCKUTILS_H
16 #define LLVM_TRANSFORMS_UTILS_BASICBLOCKUTILS_H
30 class TargetLibraryInfo;
92 Pass *
P = 0,
bool MergeIdenticalEdges =
false,
93 bool DontDeleteUselessPHIs =
false,
94 bool SplitLandingPads =
false);
107 bool MadeChange =
false;
121 bool MergeIdenticalEdges =
false,
122 bool DontDeleteUselessPHIs =
false) {
129 DontDeleteUselessPHIs);
158 const char *Suffix, Pass *
P = 0);
174 const char *Suffix,
const char *Suffix2,
175 Pass *
P, SmallVectorImpl<BasicBlock*> &NewBBs);
206 bool Unreachable, MDNode *BranchWeights = 0);
void FoldSingleEntryPHINodes(BasicBlock *BB, Pass *P=0)
void ReplaceInstWithInst(BasicBlock::InstListType &BIL, BasicBlock::iterator &BI, Instruction *I)
BasicBlock * SplitEdge(BasicBlock *From, BasicBlock *To, Pass *P)
BasicBlock * SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P=0, bool MergeIdenticalEdges=false, bool DontDeleteUselessPHIs=false, bool SplitLandingPads=false)
void DeleteDeadBlock(BasicBlock *BB)
bool MergeBlockIntoPredecessor(BasicBlock *BB, Pass *P=0)
BasicBlock * SplitBlockPredecessors(BasicBlock *BB, ArrayRef< BasicBlock * > Preds, const char *Suffix, Pass *P=0)
iplist< Instruction > InstListType
void ReplaceInstWithValue(BasicBlock::InstListType &BIL, BasicBlock::iterator &BI, Value *V)
unsigned getNumSuccessors() const
LLVM Basic Block Representation.
TerminatorInst * SplitBlockAndInsertIfThen(Instruction *Cmp, bool Unreachable, MDNode *BranchWeights=0)
BasicBlock * getSuccessor(unsigned idx) const
Value * GetIfCondition(BasicBlock *BB, BasicBlock *&IfTrue, BasicBlock *&IfFalse)
unsigned getSuccessorIndex() const
BasicBlock * SplitBlock(BasicBlock *Old, Instruction *SplitPt, Pass *P)
TerminatorInst * getTerminator()
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
ReturnInst * FoldReturnIntoUncondBranch(ReturnInst *RI, BasicBlock *BB, BasicBlock *Pred)
bool DeleteDeadPHIs(BasicBlock *BB, const TargetLibraryInfo *TLI=0)
void SplitLandingPadPredecessors(BasicBlock *OrigBB, ArrayRef< BasicBlock * > Preds, const char *Suffix, const char *Suffix2, Pass *P, SmallVectorImpl< BasicBlock * > &NewBBs)
InstListType::iterator iterator
Instruction iterators...