mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
[PM] Replace the Pass argument to SplitEdge with specific analyses used
and updated. This may appear to remove handling for things like alias analysis when splitting critical edges here, but in fact no callers of SplitEdge relied on this. Similarly, all of them wanted to preserve LCSSA if there was any update of the loop info. That makes the interface much simpler. With this, all of BasicBlockUtils.h is free of Pass arguments and prepared for the new pass manager. This is tho majority of utilities that relied on pass arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226459 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -231,22 +231,14 @@ void llvm::ReplaceInstWithInst(Instruction *From, Instruction *To) {
|
||||
|
||||
/// SplitEdge - Split the edge connecting specified block. Pass P must
|
||||
/// not be NULL.
|
||||
BasicBlock *llvm::SplitEdge(BasicBlock *BB, BasicBlock *Succ, Pass *P) {
|
||||
BasicBlock *llvm::SplitEdge(BasicBlock *BB, BasicBlock *Succ, DominatorTree *DT,
|
||||
LoopInfo *LI) {
|
||||
unsigned SuccNum = GetSuccessorNumber(BB, Succ);
|
||||
|
||||
auto *AA = P->getAnalysisIfAvailable<AliasAnalysis>();
|
||||
auto *DTWP = P->getAnalysisIfAvailable<DominatorTreeWrapperPass>();
|
||||
auto *DT = DTWP ? &DTWP->getDomTree() : nullptr;
|
||||
auto *LIWP = P->getAnalysisIfAvailable<LoopInfoWrapperPass>();
|
||||
auto *LI = LIWP ? &LIWP->getLoopInfo() : nullptr;
|
||||
bool PreserveLCSSA = P->mustPreserveAnalysisID(LCSSAID);
|
||||
auto Options = CriticalEdgeSplittingOptions(AA, DT, LI);
|
||||
if (PreserveLCSSA)
|
||||
Options.setPreserveLCSSA();
|
||||
|
||||
// If this is a critical edge, let SplitCriticalEdge do it.
|
||||
TerminatorInst *LatchTerm = BB->getTerminator();
|
||||
if (SplitCriticalEdge(LatchTerm, SuccNum, Options))
|
||||
if (SplitCriticalEdge(LatchTerm, SuccNum, CriticalEdgeSplittingOptions(DT, LI)
|
||||
.setPreserveLCSSA()))
|
||||
return LatchTerm->getSuccessor(SuccNum);
|
||||
|
||||
// If the edge isn't critical, then BB has a single successor or Succ has a
|
||||
|
Reference in New Issue
Block a user