mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 23:24:34 +00:00
Do not preserve ETForest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37506 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -61,15 +61,15 @@ bool isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum,
|
|||||||
bool AllowIdenticalEdges = false);
|
bool AllowIdenticalEdges = false);
|
||||||
|
|
||||||
/// SplitCriticalEdge - If this edge is a critical edge, insert a new node to
|
/// SplitCriticalEdge - If this edge is a critical edge, insert a new node to
|
||||||
/// split the critical edge. This will update ETForest, ImmediateDominator,
|
/// split the critical edge. This will update DominatorTree, and DominatorFrontier
|
||||||
/// DominatorTree, and DominatorFrontier information if it is available, thus
|
/// information if it is available, thus calling this pass will not invalidate
|
||||||
/// calling this pass will not invalidate either of them. This returns true if
|
/// either of them. This returns true if the edge was split, false otherwise.
|
||||||
/// the edge was split, false otherwise. If MergeIdenticalEdges is true (the
|
/// If MergeIdenticalEdges is true (the default), *all* edges from TI to the
|
||||||
/// default), *all* edges from TI to the specified successor will be merged into
|
/// specified successor will be merged into the same critical edge block.
|
||||||
/// the same critical edge block. This is most commonly interesting with switch
|
/// This is most commonly interesting with switch instructions, which may
|
||||||
/// instructions, which may have many edges to any one destination. This
|
/// have many edges to any one destination. This ensures that all edges to that
|
||||||
/// ensures that all edges to that dest go to one block instead of each going to
|
/// dest go to one block instead of each going to a different block, but isn't
|
||||||
/// a different block, but isn't the standard definition of a "critical edge".
|
/// the standard definition of a "critical edge".
|
||||||
///
|
///
|
||||||
bool SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P = 0,
|
bool SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P = 0,
|
||||||
bool MergeIdenticalEdges = false);
|
bool MergeIdenticalEdges = false);
|
||||||
|
@ -40,7 +40,6 @@ namespace {
|
|||||||
virtual bool runOnFunction(Function &F);
|
virtual bool runOnFunction(Function &F);
|
||||||
|
|
||||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
AU.addPreserved<ETForest>();
|
|
||||||
AU.addPreserved<DominatorTree>();
|
AU.addPreserved<DominatorTree>();
|
||||||
AU.addPreserved<DominanceFrontier>();
|
AU.addPreserved<DominanceFrontier>();
|
||||||
AU.addPreserved<LoopInfo>();
|
AU.addPreserved<LoopInfo>();
|
||||||
@ -110,11 +109,11 @@ bool llvm::isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SplitCriticalEdge - If this edge is a critical edge, insert a new node to
|
// SplitCriticalEdge - If this edge is a critical edge, insert a new node to
|
||||||
// split the critical edge. This will update ETForest, ImmediateDominator,
|
// split the critical edge. This will update DominatorTree, and DominatorFrontier
|
||||||
// DominatorTree, and DominatorFrontier information if it is available, thus
|
// information if it is available, thus calling this pass will not invalidate
|
||||||
// calling this pass will not invalidate any of them. This returns true if
|
// any of them. This returns true if the edge was split, false otherwise.
|
||||||
// the edge was split, false otherwise. This ensures that all edges to that
|
// This ensures that all edges to that dest go to one block instead of each
|
||||||
// dest go to one block instead of each going to a different block.
|
// going to a different block.
|
||||||
//
|
//
|
||||||
bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P,
|
bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P,
|
||||||
bool MergeIdenticalEdges) {
|
bool MergeIdenticalEdges) {
|
||||||
@ -181,26 +180,6 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P,
|
|||||||
|
|
||||||
bool NewBBDominatesDestBB = true;
|
bool NewBBDominatesDestBB = true;
|
||||||
|
|
||||||
// Update the forest?
|
|
||||||
if (ETForest *EF = P->getAnalysisToUpdate<ETForest>()) {
|
|
||||||
// NewBB is dominated by TIBB.
|
|
||||||
EF->addNewBlock(NewBB, TIBB);
|
|
||||||
|
|
||||||
// If NewBBDominatesDestBB hasn't been computed yet, do so with EF.
|
|
||||||
if (!OtherPreds.empty()) {
|
|
||||||
while (!OtherPreds.empty() && NewBBDominatesDestBB) {
|
|
||||||
NewBBDominatesDestBB = EF->dominates(DestBB, OtherPreds.back());
|
|
||||||
OtherPreds.pop_back();
|
|
||||||
}
|
|
||||||
OtherPreds.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
// If NewBBDominatesDestBB, then NewBB dominates DestBB, otherwise it
|
|
||||||
// doesn't dominate anything.
|
|
||||||
if (NewBBDominatesDestBB)
|
|
||||||
EF->setImmediateDominator(DestBB, NewBB);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Should we update DominatorTree information?
|
// Should we update DominatorTree information?
|
||||||
if (DominatorTree *DT = P->getAnalysisToUpdate<DominatorTree>()) {
|
if (DominatorTree *DT = P->getAnalysisToUpdate<DominatorTree>()) {
|
||||||
DomTreeNode *TINode = DT->getNode(TIBB);
|
DomTreeNode *TINode = DT->getNode(TIBB);
|
||||||
|
Reference in New Issue
Block a user