summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-01-19 03:03:39 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-01-19 03:03:39 +0000
commit0eae112009967cfb4ffa441e62c89fb8c38331bd (patch)
tree85349f24ad71be8c498fc8f683d17f7fdfdcd31d /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parent26500a56f5a01124dca93218c7f4ca957afa3e12 (diff)
downloadbcm5719-llvm-0eae112009967cfb4ffa441e62c89fb8c38331bd.tar.gz
bcm5719-llvm-0eae112009967cfb4ffa441e62c89fb8c38331bd.zip
[PM] Lift the analyses into the interface for
SplitLandingPadPredecessors and remove the Pass argument from its interface. Another step to the utilities being usable with both old and new pass managers. llvm-svn: 226426
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BasicBlockUtils.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index c6807884404..c2304d7642b 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -523,10 +523,11 @@ BasicBlock *llvm::SplitBlockPredecessors(BasicBlock *BB,
/// exits).
///
void llvm::SplitLandingPadPredecessors(BasicBlock *OrigBB,
- ArrayRef<BasicBlock*> Preds,
+ ArrayRef<BasicBlock *> Preds,
const char *Suffix1, const char *Suffix2,
- Pass *P,
- SmallVectorImpl<BasicBlock*> &NewBBs) {
+ SmallVectorImpl<BasicBlock *> &NewBBs,
+ AliasAnalysis *AA, DominatorTree *DT,
+ LoopInfo *LI, bool PreserveLCSSA) {
assert(OrigBB->isLandingPad() && "Trying to split a non-landing pad!");
// Create a new basic block for OrigBB's predecessors listed in Preds. Insert
@@ -549,18 +550,11 @@ void llvm::SplitLandingPadPredecessors(BasicBlock *OrigBB,
Preds[i]->getTerminator()->replaceUsesOfWith(OrigBB, NewBB1);
}
- // Update DominatorTree, LoopInfo, and LCCSA analysis information.
- 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);
bool HasLoopExit = false;
UpdateAnalysisInformation(OrigBB, NewBB1, Preds, DT, LI, PreserveLCSSA,
HasLoopExit);
// Update the PHI nodes in OrigBB with the values coming from NewBB1.
- AliasAnalysis *AA = P ? P->getAnalysisIfAvailable<AliasAnalysis>() : nullptr;
UpdatePHINodes(OrigBB, NewBB1, Preds, BI1, AA, HasLoopExit);
// Move the remaining edges from OrigBB to point to NewBB2.
OpenPOWER on IntegriCloud