1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/Transforms/JumpThreading/removed-use.ll
Eric Christopher a62270de2c Revert "Temporarily Revert "Add basic loop fusion pass.""
The reversion apparently deleted the test/Transforms directory.

Will be re-reverting again.

llvm-svn: 358552
2019-04-17 04:52:47 +00:00

55 lines
946 B
LLVM

; RUN: opt -S < %s -jump-threading | FileCheck %s
; CHECK-LABEL: @foo
; CHECK: bb6:
; CHECK-NEXT: ret void
; CHECK: bb3:
; CHECK: br label %bb3
define void @foo() {
entry:
br i1 true, label %bb6, label %bb3
bb3:
%x0 = phi i32 [ undef, %entry ], [ %x1, %bb5 ]
%y = and i64 undef, 1
%p = icmp ne i64 %y, 0
br i1 %p, label %bb4, label %bb5
bb4:
br label %bb5
bb5:
%x1 = phi i32 [ %x0, %bb3 ], [ %x0, %bb4 ]
%z = phi i32 [ 0, %bb3 ], [ 1, %bb4 ]
%q = icmp eq i32 %z, 0
br i1 %q, label %bb3, label %bb6
bb6:
ret void
}
; CHECK-LABEL: @bar
; Just check that we don't crash on this test.
define void @bar(i1 %p) {
entry:
br i1 false, label %bb2, label %exit
bb2:
%x0 = phi i32 [ undef, %entry ], [ %x1, %bb5 ]
br i1 %p, label %bb3, label %bb4
bb3:
br label %bb5
bb4:
br label %bb5
bb5:
%x1 = phi i32 [ %x0, %bb3 ], [ 0, %bb4 ]
switch i32 %x1, label %exit [
i32 10, label %bb2
]
exit:
ret void
}