LLVM  6.0.0svn
Classes | Namespaces | Functions
BasicBlockUtils.h File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/InstrTypes.h"
#include <cassert>
Include dependency graph for BasicBlockUtils.h:

Go to the source code of this file.

Classes

struct  llvm::CriticalEdgeSplittingOptions
 Option class for critical edge splitting. More...
 

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Functions

void llvm::DeleteDeadBlock (BasicBlock *BB)
 Delete the specified block, which must have no predecessors. More...
 
void llvm::FoldSingleEntryPHINodes (BasicBlock *BB, MemoryDependenceResults *MemDep=nullptr)
 We know that BB has one predecessor. More...
 
bool llvm::DeleteDeadPHIs (BasicBlock *BB, const TargetLibraryInfo *TLI=nullptr)
 Examine each PHI in the given block and delete it if it is dead. More...
 
bool llvm::MergeBlockIntoPredecessor (BasicBlock *BB, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr, MemoryDependenceResults *MemDep=nullptr)
 Attempts to merge a block into its predecessor, if possible. More...
 
void llvm::ReplaceInstWithValue (BasicBlock::InstListType &BIL, BasicBlock::iterator &BI, Value *V)
 Replace all uses of an instruction (specified by BI) with a value, then remove and delete the original instruction. More...
 
void llvm::ReplaceInstWithInst (BasicBlock::InstListType &BIL, BasicBlock::iterator &BI, Instruction *I)
 Replace the instruction specified by BI with the instruction specified by I. More...
 
void llvm::ReplaceInstWithInst (Instruction *From, Instruction *To)
 Replace the instruction specified by From with the instruction specified by To. More...
 
BasicBlockllvm::SplitCriticalEdge (TerminatorInst *TI, unsigned SuccNum, const CriticalEdgeSplittingOptions &Options=CriticalEdgeSplittingOptions())
 If this edge is a critical edge, insert a new node to split the critical edge. More...
 
BasicBlock * llvm::SplitCriticalEdge (BasicBlock *BB, succ_iterator SI, const CriticalEdgeSplittingOptions &Options=CriticalEdgeSplittingOptions())
 
bool llvm::SplitCriticalEdge (BasicBlock *Succ, pred_iterator PI, const CriticalEdgeSplittingOptions &Options=CriticalEdgeSplittingOptions())
 If the edge from *PI to BB is not critical, return false. More...
 
BasicBlock * llvm::SplitCriticalEdge (BasicBlock *Src, BasicBlock *Dst, const CriticalEdgeSplittingOptions &Options=CriticalEdgeSplittingOptions())
 If an edge from Src to Dst is critical, split the edge and return true, otherwise return false. More...
 
unsigned llvm::SplitAllCriticalEdges (Function &F, const CriticalEdgeSplittingOptions &Options=CriticalEdgeSplittingOptions())
 Loop over all of the edges in the CFG, breaking critical edges as they are found. More...
 
BasicBlockllvm::SplitEdge (BasicBlock *From, BasicBlock *To, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr)
 Split the edge connecting specified block. More...
 
BasicBlockllvm::SplitBlock (BasicBlock *Old, Instruction *SplitPt, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr)
 Split the specified block at the specified instruction - everything before SplitPt stays in Old and everything starting with SplitPt moves to a new block. More...
 
BasicBlockllvm::SplitBlockPredecessors (BasicBlock *BB, ArrayRef< BasicBlock *> Preds, const char *Suffix, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr, bool PreserveLCSSA=false)
 This method introduces at least one new basic block into the function and moves some of the predecessors of BB to be predecessors of the new block. More...
 
void llvm::SplitLandingPadPredecessors (BasicBlock *OrigBB, ArrayRef< BasicBlock *> Preds, const char *Suffix, const char *Suffix2, SmallVectorImpl< BasicBlock *> &NewBBs, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr, bool PreserveLCSSA=false)
 This method transforms the landing pad, OrigBB, by introducing two new basic blocks into the function. More...
 
ReturnInstllvm::FoldReturnIntoUncondBranch (ReturnInst *RI, BasicBlock *BB, BasicBlock *Pred)
 This method duplicates the specified return instruction into a predecessor which ends in an unconditional branch. More...
 
TerminatorInstllvm::SplitBlockAndInsertIfThen (Value *Cond, Instruction *SplitBefore, bool Unreachable, MDNode *BranchWeights=nullptr, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr)
 Split the containing block at the specified instruction - everything before SplitBefore stays in the old basic block, and the rest of the instructions in the BB are moved to a new block. More...
 
void llvm::SplitBlockAndInsertIfThenElse (Value *Cond, Instruction *SplitBefore, TerminatorInst **ThenTerm, TerminatorInst **ElseTerm, MDNode *BranchWeights=nullptr)
 SplitBlockAndInsertIfThenElse is similar to SplitBlockAndInsertIfThen, but also creates the ElseBlock. More...
 
Valuellvm::GetIfCondition (BasicBlock *BB, BasicBlock *&IfTrue, BasicBlock *&IfFalse)
 Check whether BB is the merge point of a if-region. More...