mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[LoopSimplifyCFG] Do not count dead exit blocks twice, make CFG simpler
llvm-svn: 353276
This commit is contained in:
parent
76e7af4002
commit
126ecfaee6
@ -229,8 +229,10 @@ private:
|
||||
// Now, all exit blocks that are not marked as live are dead.
|
||||
SmallVector<BasicBlock *, 8> ExitBlocks;
|
||||
L.getExitBlocks(ExitBlocks);
|
||||
SmallPtrSet<BasicBlock *, 8> UniqueDeadExits;
|
||||
for (auto *ExitBlock : ExitBlocks)
|
||||
if (!LiveExitBlocks.count(ExitBlock))
|
||||
if (!LiveExitBlocks.count(ExitBlock) &&
|
||||
UniqueDeadExits.insert(ExitBlock).second)
|
||||
DeadExitBlocks.push_back(ExitBlock);
|
||||
|
||||
// Whether or not the edge From->To will still be present in graph after the
|
||||
|
@ -288,8 +288,6 @@ define i32 @dead_exit_test_switch_loop(i32 %end) {
|
||||
; CHECK-NEXT: preheader:
|
||||
; CHECK-NEXT: switch i32 0, label [[PREHEADER_SPLIT:%.*]] [
|
||||
; CHECK-NEXT: i32 1, label [[DEAD:%.*]]
|
||||
; CHECK-NEXT: i32 2, label [[DEAD]]
|
||||
; CHECK-NEXT: i32 3, label [[DEAD]]
|
||||
; CHECK-NEXT: ]
|
||||
; CHECK: preheader-split:
|
||||
; CHECK-NEXT: br label [[HEADER:%.*]]
|
||||
|
Loading…
x
Reference in New Issue
Block a user