mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
[Simplify] Add testcase to show that merging conditional stores for triangles is sensitive to the order of the branch targets on the conditional branches. NFC
llvm-svn: 300915
This commit is contained in:
parent
2966c6087f
commit
b0c6763f18
@ -36,6 +36,45 @@ end:
|
|||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; This is the same as test_simple, but the branch target order has been swapped
|
||||||
|
; TODO: This test should succeed and end up if-converted.
|
||||||
|
define void @test_simple_commuted(i32* %p, i32 %a, i32 %b) {
|
||||||
|
; CHECK-LABEL: @test_simple_commuted(
|
||||||
|
; CHECK-NEXT: entry:
|
||||||
|
; CHECK-NEXT: [[X1:%.*]] = icmp eq i32 [[A:%.*]], 0
|
||||||
|
; CHECK-NEXT: br i1 [[X1]], label [[YES1:%.*]], label [[FALLTHROUGH:%.*]]
|
||||||
|
; CHECK: yes1:
|
||||||
|
; CHECK-NEXT: store i32 0, i32* [[P:%.*]], align 4
|
||||||
|
; CHECK-NEXT: br label [[FALLTHROUGH]]
|
||||||
|
; CHECK: fallthrough:
|
||||||
|
; CHECK-NEXT: [[X2:%.*]] = icmp eq i32 [[B:%.*]], 0
|
||||||
|
; CHECK-NEXT: br i1 [[X2]], label [[YES2:%.*]], label [[END:%.*]]
|
||||||
|
; CHECK: yes2:
|
||||||
|
; CHECK-NEXT: store i32 1, i32* [[P]], align 4
|
||||||
|
; CHECK-NEXT: br label [[END]]
|
||||||
|
; CHECK: end:
|
||||||
|
; CHECK-NEXT: ret void
|
||||||
|
;
|
||||||
|
entry:
|
||||||
|
%x1 = icmp eq i32 %a, 0
|
||||||
|
br i1 %x1, label %yes1, label %fallthrough
|
||||||
|
|
||||||
|
yes1:
|
||||||
|
store i32 0, i32* %p
|
||||||
|
br label %fallthrough
|
||||||
|
|
||||||
|
fallthrough:
|
||||||
|
%x2 = icmp eq i32 %b, 0
|
||||||
|
br i1 %x2, label %yes2, label %end
|
||||||
|
|
||||||
|
yes2:
|
||||||
|
store i32 1, i32* %p
|
||||||
|
br label %end
|
||||||
|
|
||||||
|
end:
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
; This test should entirely fold away, leaving one large basic block.
|
; This test should entirely fold away, leaving one large basic block.
|
||||||
define void @test_recursive(i32* %p, i32 %a, i32 %b, i32 %c, i32 %d) {
|
define void @test_recursive(i32* %p, i32 %a, i32 %b, i32 %c, i32 %d) {
|
||||||
; CHECK-LABEL: @test_recursive(
|
; CHECK-LABEL: @test_recursive(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user