class LoopInfo;
class Instruction;
class MDNode;
-class Pass;
class ReturnInst;
class TargetLibraryInfo;
class TerminatorInst;
LoopInfo *LI;
bool MergeIdenticalEdges;
bool DontDeleteUselessPHIs;
- bool SplitLandingPads;
bool PreserveLCSSA;
CriticalEdgeSplittingOptions()
: AA(nullptr), DT(nullptr), LI(nullptr), MergeIdenticalEdges(false),
- DontDeleteUselessPHIs(false), SplitLandingPads(false),
- PreserveLCSSA(false) {}
+ DontDeleteUselessPHIs(false), PreserveLCSSA(false) {}
/// \brief Basic case of setting up all the analysis.
CriticalEdgeSplittingOptions(AliasAnalysis *AA, DominatorTree *DT = nullptr,
LoopInfo *LI = nullptr)
: AA(AA), DT(DT), LI(LI), MergeIdenticalEdges(false),
- DontDeleteUselessPHIs(false), SplitLandingPads(false),
- PreserveLCSSA(false) {}
+ DontDeleteUselessPHIs(false), PreserveLCSSA(false) {}
/// \brief A common pattern is to preserve the dominator tree and loop
/// info but not care about AA.
CriticalEdgeSplittingOptions(DominatorTree *DT, LoopInfo *LI)
: AA(nullptr), DT(DT), LI(LI), MergeIdenticalEdges(false),
- DontDeleteUselessPHIs(false), SplitLandingPads(false),
- PreserveLCSSA(false) {}
+ DontDeleteUselessPHIs(false), PreserveLCSSA(false) {}
CriticalEdgeSplittingOptions &setMergeIdenticalEdges() {
MergeIdenticalEdges = true;
return *this;
}
- CriticalEdgeSplittingOptions &setSplitLandingPads() {
- SplitLandingPads = true;
- return *this;
- }
-
CriticalEdgeSplittingOptions &setPreserveLCSSA() {
PreserveLCSSA = true;
return *this;
const CriticalEdgeSplittingOptions &Options =
CriticalEdgeSplittingOptions());
-/// SplitEdge - Split the edge connecting specified block. Pass P must
-/// not be NULL.
-BasicBlock *SplitEdge(BasicBlock *From, BasicBlock *To, Pass *P);
+/// SplitEdge - Split the edge connecting specified block.
+BasicBlock *SplitEdge(BasicBlock *From, BasicBlock *To,
+ DominatorTree *DT = nullptr, LoopInfo *LI = nullptr);
/// SplitBlock - Split the specified block at the specified instruction - every
/// thing before SplitPt stays in Old and everything starting with SplitPt moves
BasicBlock *SplitBlock(BasicBlock *Old, Instruction *SplitPt,
DominatorTree *DT = nullptr, LoopInfo *LI = nullptr);
-/// SplitBlockPredecessors - This method transforms BB by introducing a new
-/// basic block into the function, and moving some of the predecessors of BB to
-/// be predecessors of the new block. The new predecessors are indicated by the
-/// Preds array, which has NumPreds elements in it. The new block is given a
-/// suffix of 'Suffix'. This function returns the new block.
+/// SplitBlockPredecessors - 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. The new predecessors are indicated by the
+/// Preds array. The new block is given a suffix of 'Suffix'. Returns new basic
+/// block to which predecessors from Preds are now pointing.
+///
+/// If BB is a landingpad block then additional basicblock might be introduced.
+/// It will have Suffix+".split_lp". See SplitLandingPadPredecessors for more
+/// details on this case.
///
/// This currently updates the LLVM IR, AliasAnalysis, DominatorTree,
/// DominanceFrontier, LoopInfo, and LCCSA but no other analyses.