summaryrefslogtreecommitdiff
path: root/test/Transforms/StructurizeCFG
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/StructurizeCFG')
-rw-r--r--test/Transforms/StructurizeCFG/invert-constantexpr.ll30
-rw-r--r--test/Transforms/StructurizeCFG/nested-loop-order.ll13
2 files changed, 31 insertions, 12 deletions
diff --git a/test/Transforms/StructurizeCFG/invert-constantexpr.ll b/test/Transforms/StructurizeCFG/invert-constantexpr.ll
new file mode 100644
index 000000000000..fc50a5a90a7f
--- /dev/null
+++ b/test/Transforms/StructurizeCFG/invert-constantexpr.ll
@@ -0,0 +1,30 @@
+; RUN: opt -S -o - -structurizecfg < %s | FileCheck %s
+
+; CHECK-LABEL: @invert_constantexpr_condition(
+; CHECK: %tmp5 = or i1 %tmp4, icmp eq (i32 bitcast (float fadd (float undef, float undef) to i32), i32 0)
+; CHECK: [ icmp ne (i32 bitcast (float fadd (float undef, float undef) to i32), i32 0), %bb ]
+define void @invert_constantexpr_condition(i32 %arg, i32 %arg1) #0 {
+bb:
+ %tmp = icmp eq i32 %arg, 0
+ br i1 icmp eq (i32 bitcast (float fadd (float undef, float undef) to i32), i32 0), label %bb2, label %bb6
+
+bb2:
+ br i1 %tmp, label %bb3, label %bb6
+
+bb3:
+ %tmp4 = phi i1 [ %tmp7, %bb6 ], [ undef, %bb2 ]
+ %tmp5 = or i1 %tmp4, icmp eq (i32 bitcast (float fadd (float undef, float undef) to i32), i32 0)
+ br i1 %tmp5, label %bb8, label %bb8
+
+bb6:
+ %tmp7 = icmp slt i32 %arg, %arg1
+ br label %bb3
+
+bb8:
+ ret void
+}
+
+declare i32 @llvm.amdgcn.workitem.id.x() #1
+
+attributes #0 = { nounwind }
+attributes #1 = { nounwind readnone }
diff --git a/test/Transforms/StructurizeCFG/nested-loop-order.ll b/test/Transforms/StructurizeCFG/nested-loop-order.ll
index 8a506c3e3962..58634d0d37db 100644
--- a/test/Transforms/StructurizeCFG/nested-loop-order.ll
+++ b/test/Transforms/StructurizeCFG/nested-loop-order.ll
@@ -63,17 +63,6 @@ ENDIF28: ; preds = %ENDIF
br i1 %tmp36, label %ENDLOOP, label %LOOP.outer
}
-; Function Attrs: nounwind readnone
-declare <4 x float> @llvm.SI.vs.load.input(<16 x i8>, i32, i32) #1
-
-; Function Attrs: readnone
-declare float @llvm.AMDIL.clamp.(float, float, float) #2
-
-declare void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float)
-
-attributes #0 = { "ShaderType"="1" "enable-no-nans-fp-math"="true" "unsafe-fp-math"="true" }
+attributes #0 = { "enable-no-nans-fp-math"="true" "unsafe-fp-math"="true" }
attributes #1 = { nounwind readnone }
attributes #2 = { readnone }
-
-!0 = !{!1, !1, i64 0, i32 1}
-!1 = !{!"const", null}