mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
cf44f794e4
-loop-extract-single is just -loop-extract on one loop. -loop-extract depended on -break-crit-edges and -loop-simplify in the legacy PM, but the NPM doesn't allow specifying pass dependencies like that, so manually add those passes to the RUN lines where necessary. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D89016
47 lines
1.3 KiB
LLVM
47 lines
1.3 KiB
LLVM
; RUN: opt < %s -inline -loop-simplify -loop-extract -S | FileCheck %s
|
|
; RUN: opt < %s -argpromotion -loop-simplify -loop-extract -S | FileCheck %s
|
|
|
|
; This test used to trigger an assert (PR8929).
|
|
|
|
define void @test() {
|
|
; CHECK-LABEL: define void @test()
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: br label %codeRepl
|
|
; CHECK: codeRepl:
|
|
; CHECK-NEXT: call void @test.loopentry()
|
|
; CHECK-NEXT: br label %loopexit
|
|
; CHECK: loopexit:
|
|
; CHECK-NEXT: br label %exit
|
|
; CHECK: exit:
|
|
; CHECK-NEXT: ret void
|
|
|
|
entry:
|
|
br label %loopentry
|
|
|
|
loopentry: ; preds = %loopbody, %entry
|
|
br i1 undef, label %loopbody, label %loopexit
|
|
|
|
loopbody: ; preds = %codeRepl1
|
|
call void @foo()
|
|
br label %loopentry
|
|
|
|
loopexit: ; preds = %codeRepl
|
|
br label %exit
|
|
|
|
exit: ; preds = %loopexit
|
|
ret void
|
|
}
|
|
|
|
declare void @foo()
|
|
|
|
; CHECK-LABEL: define internal void @test.loopentry()
|
|
; CHECK-NEXT: newFuncRoot:
|
|
; CHECK-NEXT: br label %loopentry
|
|
; CHECK: loopexit.exitStub:
|
|
; CHECK-NEXT: ret void
|
|
; CHECK: loopentry:
|
|
; CHECK-NEXT: br i1 false, label %loopbody, label %loopexit.exitStub
|
|
; CHECK: loopbody:
|
|
; CHECK-NEXT: call void @foo()
|
|
; CHECK-NEXT: br label %loopentry
|