Skip to content

Commit bd38203

Browse files
authored
[BBUtils][NFC] Delete SplitLandingPadPredecessors with DT (llvm#73406)
Function is marked for deprecation. There is only one consumer which is converted to use DomTreeUpdater.
1 parent b3e80d8 commit bd38203

File tree

3 files changed

+3
-33
lines changed

3 files changed

+3
-33
lines changed

llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -367,27 +367,6 @@ BasicBlock *SplitBlockPredecessors(BasicBlock *BB, ArrayRef<BasicBlock *> Preds,
367367
MemorySSAUpdater *MSSAU = nullptr,
368368
bool PreserveLCSSA = false);
369369

370-
/// This method transforms the landing pad, OrigBB, by introducing two new basic
371-
/// blocks into the function. One of those new basic blocks gets the
372-
/// predecessors listed in Preds. The other basic block gets the remaining
373-
/// predecessors of OrigBB. The landingpad instruction OrigBB is clone into both
374-
/// of the new basic blocks. The new blocks are given the suffixes 'Suffix1' and
375-
/// 'Suffix2', and are returned in the NewBBs vector.
376-
///
377-
/// This currently updates the LLVM IR, DominatorTree, LoopInfo, and LCCSA but
378-
/// no other analyses. In particular, it does not preserve LoopSimplify
379-
/// (because it's complicated to handle the case where one of the edges being
380-
/// split is an exit of a loop with other exits).
381-
///
382-
/// FIXME: deprecated, switch to the DomTreeUpdater-based one.
383-
void SplitLandingPadPredecessors(BasicBlock *OrigBB,
384-
ArrayRef<BasicBlock *> Preds,
385-
const char *Suffix, const char *Suffix2,
386-
SmallVectorImpl<BasicBlock *> &NewBBs,
387-
DominatorTree *DT, LoopInfo *LI = nullptr,
388-
MemorySSAUpdater *MSSAU = nullptr,
389-
bool PreserveLCSSA = false);
390-
391370
/// This method transforms the landing pad, OrigBB, by introducing two new basic
392371
/// blocks into the function. One of those new basic blocks gets the
393372
/// predecessors listed in Preds. The other basic block gets the remaining

llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
#include "llvm/ADT/Statistic.h"
6868
#include "llvm/ADT/iterator_range.h"
6969
#include "llvm/Analysis/AssumptionCache.h"
70+
#include "llvm/Analysis/DomTreeUpdater.h"
7071
#include "llvm/Analysis/IVUsers.h"
7172
#include "llvm/Analysis/LoopAnalysisManager.h"
7273
#include "llvm/Analysis/LoopInfo.h"
@@ -5599,7 +5600,8 @@ void LSRInstance::RewriteForPHI(
55995600
.setKeepOneInputPHIs());
56005601
} else {
56015602
SmallVector<BasicBlock*, 2> NewBBs;
5602-
SplitLandingPadPredecessors(Parent, BB, "", "", NewBBs, &DT, &LI);
5603+
DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Eager);
5604+
SplitLandingPadPredecessors(Parent, BB, "", "", NewBBs, &DTU, &LI);
56035605
NewBB = NewBBs[0];
56045606
}
56055607
// If NewBB==NULL, then SplitCriticalEdge refused to split because all

llvm/lib/Transforms/Utils/BasicBlockUtils.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,17 +1452,6 @@ static void SplitLandingPadPredecessorsImpl(
14521452
}
14531453
}
14541454

1455-
void llvm::SplitLandingPadPredecessors(BasicBlock *OrigBB,
1456-
ArrayRef<BasicBlock *> Preds,
1457-
const char *Suffix1, const char *Suffix2,
1458-
SmallVectorImpl<BasicBlock *> &NewBBs,
1459-
DominatorTree *DT, LoopInfo *LI,
1460-
MemorySSAUpdater *MSSAU,
1461-
bool PreserveLCSSA) {
1462-
return SplitLandingPadPredecessorsImpl(
1463-
OrigBB, Preds, Suffix1, Suffix2, NewBBs,
1464-
/*DTU=*/nullptr, DT, LI, MSSAU, PreserveLCSSA);
1465-
}
14661455
void llvm::SplitLandingPadPredecessors(BasicBlock *OrigBB,
14671456
ArrayRef<BasicBlock *> Preds,
14681457
const char *Suffix1, const char *Suffix2,

0 commit comments

Comments
 (0)