mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Fix for PR5373, Credit to Jakub Staszak.
llvm-svn: 89758
This commit is contained in:
parent
b81878ed80
commit
8c1cd4fdbc
@ -296,7 +296,6 @@ static bool isTrivialLoopExitBlockHelper(Loop *L, BasicBlock *BB,
|
|||||||
// first exit.
|
// first exit.
|
||||||
if (ExitBB != 0) return false;
|
if (ExitBB != 0) return false;
|
||||||
ExitBB = BB;
|
ExitBB = BB;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, this is an unvisited intra-loop node. Check all successors.
|
// Otherwise, this is an unvisited intra-loop node. Check all successors.
|
||||||
|
24
test/Transforms/LoopUnswitch/5373.ll
Normal file
24
test/Transforms/LoopUnswitch/5373.ll
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
; RUN: opt < %s -loop-unswitch -stats -disable-output |& grep "3 loop-unswitch - Number of branches unswitched"
|
||||||
|
|
||||||
|
define noalias i32* @func_16(i32** %p_18, i32* %p_20) noreturn nounwind ssp {
|
||||||
|
entry:
|
||||||
|
%lnot = icmp eq i32** %p_18, null ; <i1> [#uses=1]
|
||||||
|
%lnot6 = icmp eq i32* %p_20, null ; <i1> [#uses=1]
|
||||||
|
br label %for.body
|
||||||
|
|
||||||
|
for.body: ; preds = %cond.end, %entry
|
||||||
|
br i1 %lnot, label %cond.end, label %cond.true
|
||||||
|
|
||||||
|
cond.true: ; preds = %for.body
|
||||||
|
tail call void @f()
|
||||||
|
unreachable
|
||||||
|
|
||||||
|
cond.end: ; preds = %for.body
|
||||||
|
br i1 %lnot6, label %for.body, label %cond.true10
|
||||||
|
|
||||||
|
cond.true10: ; preds = %cond.end
|
||||||
|
tail call void @f()
|
||||||
|
unreachable
|
||||||
|
}
|
||||||
|
|
||||||
|
declare void @f() noreturn
|
Loading…
Reference in New Issue
Block a user