mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-24 20:30:06 +00:00
Codegen: Tail Duplication: Only duplicate into layout pred if it is a CFG Pred.
Add a check that the layout predecessor of a block is an actual CFG predecssor of the block as well. No current code fails this check, but upcoming patches can trigger this, and it makes sense to separate it out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276066 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
98e46ef19c
commit
3d7281b8c9
@ -824,6 +824,8 @@ bool TailDuplicator::tailDuplicate(MachineFunction &MF, bool IsSimple,
|
||||
// This has to check PrevBB->succ_size() because EH edges are ignored by
|
||||
// AnalyzeBranch.
|
||||
if (PrevBB->succ_size() == 1 &&
|
||||
// Layout preds are not always CFG preds. Check.
|
||||
*PrevBB->succ_begin() == TailBB &&
|
||||
!TII->analyzeBranch(*PrevBB, PriorTBB, PriorFBB, PriorCond, true) &&
|
||||
PriorCond.empty() && !PriorTBB && TailBB->pred_size() == 1 &&
|
||||
!TailBB->hasAddressTaken()) {
|
||||
|
Loading…
Reference in New Issue
Block a user