summaryrefslogtreecommitdiff
path: root/test/Transforms/LICM/hoisting.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/LICM/hoisting.ll')
-rw-r--r--test/Transforms/LICM/hoisting.ll24
1 files changed, 15 insertions, 9 deletions
diff --git a/test/Transforms/LICM/hoisting.ll b/test/Transforms/LICM/hoisting.ll
index 8609407cc599..cb6981ede1e7 100644
--- a/test/Transforms/LICM/hoisting.ll
+++ b/test/Transforms/LICM/hoisting.ll
@@ -1,4 +1,5 @@
; RUN: opt < %s -licm -S | FileCheck %s
+; RUN: opt -lcssa %s | opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,loop(licm)' -S | FileCheck %s
@X = global i32 0 ; <i32*> [#uses=1]
@@ -37,16 +38,21 @@ define i32 @test2(i1 %c) {
; CHECK-LABEL: @test2(
; CHECK-NEXT: load i32, i32* @X
; CHECK-NEXT: %B = sdiv i32 4, %A
- %A = load i32, i32* @X ; <i32> [#uses=2]
- br label %Loop
+ %A = load i32, i32* @X
+ br label %Loop
+
Loop:
- ;; Should have hoisted this div!
- %B = sdiv i32 4, %A ; <i32> [#uses=2]
- call void @foo2( i32 %B )
- br i1 %c, label %Loop, label %Out
-Out: ; preds = %Loop
- %C = sub i32 %A, %B ; <i32> [#uses=1]
- ret i32 %C
+ ;; Should have hoisted this div!
+ %B = sdiv i32 4, %A
+ br label %loop2
+
+loop2:
+ call void @foo2( i32 %B )
+ br i1 %c, label %Loop, label %Out
+
+Out:
+ %C = sub i32 %A, %B
+ ret i32 %C
}