forked from OSchip/llvm-project
[NFC] Simplify and reduce tests for PR39783
llvm-svn: 347976
This commit is contained in:
parent
c6b1af510f
commit
deaa3e2068
|
@ -0,0 +1,111 @@
|
|||
; XFAIL: *
|
||||
; REQUIRES: asserts
|
||||
; RUN: opt -march=z13 -S -loop-simplifycfg -enable-mssa-loop-dependency -enable-loop-simplifycfg-term-folding 2>&1 < %s | FileCheck %s
|
||||
target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
|
||||
|
||||
@global = external dso_local local_unnamed_addr global i8, align 2
|
||||
@global.1 = external dso_local local_unnamed_addr global i32, align 4
|
||||
@global.2 = external dso_local local_unnamed_addr global i32, align 4
|
||||
@global.3 = external dso_local local_unnamed_addr global i16, align 2
|
||||
@global.4 = external dso_local local_unnamed_addr global i32, align 4
|
||||
|
||||
; CHECK-LABEL: @test_01(
|
||||
|
||||
define internal fastcc void @test_01() unnamed_addr {
|
||||
bb:
|
||||
%tmp = load i32, i32* @global.2, align 4
|
||||
%tmp1 = icmp eq i32 %tmp, 0
|
||||
br i1 %tmp1, label %bb3, label %bb2
|
||||
|
||||
bb2: ; preds = %bb
|
||||
br label %bb7
|
||||
|
||||
bb3: ; preds = %bb
|
||||
br label %bb4
|
||||
|
||||
bb4: ; preds = %bb6, %bb3
|
||||
br i1 true, label %bb5, label %bb6
|
||||
|
||||
bb5: ; preds = %bb4
|
||||
store i16 0, i16* @global.3, align 2
|
||||
br label %bb6
|
||||
|
||||
bb6: ; preds = %bb5, %bb4
|
||||
br label %bb4
|
||||
|
||||
bb7: ; preds = %bb7, %bb2
|
||||
%tmp8 = phi i32 [ 1, %bb7 ], [ 0, %bb2 ]
|
||||
%tmp9 = icmp eq i32 %tmp8, 0
|
||||
br i1 %tmp9, label %bb7, label %bb10
|
||||
|
||||
bb10: ; preds = %bb7
|
||||
br label %bb11
|
||||
|
||||
bb11: ; preds = %bb13, %bb10
|
||||
%tmp12 = icmp ult i32 %tmp, 6
|
||||
br i1 %tmp12, label %bb13, label %bb14
|
||||
|
||||
bb13: ; preds = %bb11
|
||||
store i32 0, i32* @global.1, align 4
|
||||
br label %bb11
|
||||
|
||||
bb14: ; preds = %bb11
|
||||
ret void
|
||||
}
|
||||
|
||||
@global.5 = external dso_local local_unnamed_addr global i16, align 2
|
||||
|
||||
declare dso_local void @spam() local_unnamed_addr
|
||||
|
||||
declare dso_local void @blam() local_unnamed_addr
|
||||
|
||||
declare dso_local i64 @quux.1() local_unnamed_addr
|
||||
|
||||
declare dso_local void @bar() local_unnamed_addr
|
||||
|
||||
; CHECK-LABEL: @test_02(
|
||||
|
||||
define dso_local void @test_02(i8 signext %arg) local_unnamed_addr {
|
||||
bb:
|
||||
br label %bb1
|
||||
|
||||
bb1: ; preds = %bb16, %bb
|
||||
%tmp = phi i8 [ %arg, %bb ], [ %tmp17, %bb16 ]
|
||||
%tmp2 = load i16, i16* @global.5, align 2
|
||||
%tmp3 = icmp ugt i16 %tmp2, 56
|
||||
br i1 %tmp3, label %bb4, label %bb18
|
||||
|
||||
bb4: ; preds = %bb1
|
||||
%tmp5 = tail call i64 @quux.1()
|
||||
%tmp6 = icmp eq i64 %tmp5, 0
|
||||
br i1 %tmp6, label %bb13, label %bb7
|
||||
|
||||
bb7: ; preds = %bb4
|
||||
br label %bb8
|
||||
|
||||
bb8: ; preds = %bb8, %bb7
|
||||
%tmp9 = phi i32 [ 26, %bb7 ], [ %tmp10, %bb8 ]
|
||||
tail call void @bar()
|
||||
%tmp10 = add nsw i32 %tmp9, -1
|
||||
%tmp11 = icmp eq i32 %tmp10, 12
|
||||
br i1 %tmp11, label %bb12, label %bb8
|
||||
|
||||
bb12: ; preds = %bb8
|
||||
br i1 false, label %bb14, label %bb16
|
||||
|
||||
bb13: ; preds = %bb4
|
||||
tail call void @spam()
|
||||
br label %bb14
|
||||
|
||||
bb14: ; preds = %bb13, %bb12
|
||||
%tmp15 = phi i8 [ -23, %bb12 ], [ %tmp, %bb13 ]
|
||||
tail call void @blam()
|
||||
br label %bb16
|
||||
|
||||
bb16: ; preds = %bb14, %bb12
|
||||
%tmp17 = phi i8 [ %tmp15, %bb14 ], [ -23, %bb12 ]
|
||||
br label %bb1
|
||||
|
||||
bb18: ; preds = %bb1
|
||||
ret void
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
; XFAIL: *
|
||||
; RUN: opt -march=z13 -S -O3 -enable-simple-loop-unswitch -enable-mssa-loop-dependency -enable-loop-simplifycfg-term-folding 2>&1 < %s | FileCheck %s
|
||||
; CHECK-LABEL: @main(
|
||||
|
||||
target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
|
||||
|
||||
@g_45 = external dso_local global i8, align 2
|
||||
@g_182 = external dso_local global i32, align 4
|
||||
@g_277 = external dso_local global i32, align 4
|
||||
@g_1135 = external dso_local global i16, align 2
|
||||
@g_2998 = external dso_local global i32, align 4
|
||||
|
||||
; Function Attrs: nounwind
|
||||
define dso_local signext i32 @main(i32 signext %arg, i8** %arg1) #0 {
|
||||
bb:
|
||||
%tmp = call signext i32 @0()
|
||||
unreachable
|
||||
}
|
||||
|
||||
; Function Attrs: nounwind
|
||||
define internal signext i32 @0() #0 {
|
||||
bb:
|
||||
%tmp = call signext i32 @1(i32 zeroext 0, i64 undef)
|
||||
ret i32 undef
|
||||
}
|
||||
|
||||
; Function Attrs: nounwind
|
||||
define internal signext i32 @1(i32 zeroext %arg, i64 %arg1) #0 {
|
||||
bb:
|
||||
%tmp = alloca i32, align 4
|
||||
%tmp2 = alloca i32, align 4
|
||||
store i32 %arg, i32* %tmp, align 4, !tbaa !1
|
||||
br label %bb3
|
||||
|
||||
bb3: ; preds = %bb42, %bb
|
||||
store i32 48, i32* %tmp2, align 4
|
||||
%tmp4 = load i32, i32* %tmp2, align 4
|
||||
%tmp5 = icmp eq i32 %tmp4, 48
|
||||
br i1 %tmp5, label %bb6, label %bb42
|
||||
|
||||
bb6: ; preds = %bb9, %bb3
|
||||
%tmp7 = load i32, i32* @g_277, align 4, !tbaa !1
|
||||
%tmp8 = icmp ule i32 %tmp7, 0
|
||||
br i1 %tmp8, label %bb9, label %bb16
|
||||
|
||||
bb9: ; preds = %bb15, %bb6
|
||||
%tmp10 = icmp sle i32 0, 5
|
||||
%tmp11 = load i32, i32* %tmp, align 4, !tbaa !1
|
||||
br i1 %tmp10, label %bb12, label %bb6
|
||||
|
||||
bb12: ; preds = %bb9
|
||||
%tmp13 = icmp ne i32 %tmp11, 0
|
||||
br i1 %tmp13, label %bb15, label %bb14
|
||||
|
||||
bb14: ; preds = %bb12
|
||||
store i16 0, i16* @g_1135, align 2, !tbaa !5
|
||||
br label %bb15
|
||||
|
||||
bb15: ; preds = %bb14, %bb12
|
||||
br label %bb9
|
||||
|
||||
bb16: ; preds = %bb20, %bb6
|
||||
%tmp17 = load i32, i32* %tmp, align 4, !tbaa !1
|
||||
%tmp18 = icmp ule i32 %tmp17, 0
|
||||
br i1 %tmp18, label %bb19, label %bb22
|
||||
|
||||
bb19: ; preds = %bb19, %bb16
|
||||
br i1 undef, label %bb19, label %bb20
|
||||
|
||||
bb20: ; preds = %bb19
|
||||
%tmp21 = add i32 0, 1
|
||||
store i32 %tmp21, i32* %tmp, align 4, !tbaa !1
|
||||
br label %bb16
|
||||
|
||||
bb22: ; preds = %bb40, %bb16
|
||||
%tmp23 = load i32, i32* @g_277, align 4, !tbaa !1
|
||||
%tmp24 = icmp ule i32 %tmp23, 5
|
||||
br i1 %tmp24, label %bb25, label %bb42
|
||||
|
||||
bb25: ; preds = %bb22
|
||||
store i32 0, i32* @g_182, align 4, !tbaa !1
|
||||
br label %bb26
|
||||
|
||||
bb26: ; preds = %bb29, %bb25
|
||||
%tmp27 = load i32, i32* @g_182, align 4, !tbaa !1
|
||||
%tmp28 = icmp ule i32 %tmp27, 0
|
||||
br i1 %tmp28, label %bb29, label %bb31
|
||||
|
||||
bb29: ; preds = %bb26
|
||||
%tmp30 = load i32*, i32** undef, align 8, !tbaa !7
|
||||
br i1 undef, label %bb26, label %bb40
|
||||
|
||||
bb31: ; preds = %bb35, %bb26
|
||||
%tmp32 = load i32, i32* @g_2998, align 4, !tbaa !1
|
||||
%tmp33 = icmp sle i32 %tmp32, 5
|
||||
br i1 %tmp33, label %bb34, label %bb39
|
||||
|
||||
bb34: ; preds = %bb34, %bb31
|
||||
br i1 undef, label %bb34, label %bb35
|
||||
|
||||
bb35: ; preds = %bb35, %bb34
|
||||
%tmp36 = load i8, i8* @g_45, align 2, !tbaa !9
|
||||
%tmp37 = zext i8 %tmp36 to i32
|
||||
%tmp38 = icmp sle i32 %tmp37, 5
|
||||
br i1 %tmp38, label %bb35, label %bb31
|
||||
|
||||
bb39: ; preds = %bb31
|
||||
store i32 0, i32* %tmp2, align 4
|
||||
br label %bb40
|
||||
|
||||
bb40: ; preds = %bb39, %bb29
|
||||
%tmp41 = icmp eq i32 0, 0
|
||||
br i1 %tmp41, label %bb22, label %bb42
|
||||
|
||||
bb42: ; preds = %bb40, %bb22, %bb3
|
||||
%tmp43 = load i32, i32* %tmp2, align 4
|
||||
%tmp44 = icmp eq i32 %tmp43, 0
|
||||
br i1 %tmp44, label %bb3, label %bb45
|
||||
|
||||
bb45: ; preds = %bb42
|
||||
ret i32 undef
|
||||
}
|
||||
|
||||
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="z13" "target-features"="+transactional-execution,+vector" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
||||
|
||||
!1 = !{!2, !2, i64 0}
|
||||
!2 = !{!"int", !3, i64 0}
|
||||
!3 = !{!"omnipotent char", !4, i64 0}
|
||||
!4 = !{!"Simple C/C++ TBAA"}
|
||||
!5 = !{!6, !6, i64 0}
|
||||
!6 = !{!"short", !3, i64 0}
|
||||
!7 = !{!8, !8, i64 0}
|
||||
!8 = !{!"any pointer", !3, i64 0}
|
||||
!9 = !{!3, !3, i64 0}
|
|
@ -1,145 +0,0 @@
|
|||
; XFAIL: *
|
||||
; RUN: opt -S -march=z13 -O3 -enable-simple-loop-unswitch -enable-mssa-loop-dependency -enable-loop-simplifycfg-term-folding 2>&1 < %s | FileCheck %s
|
||||
; CHECK-LABEL: @safe_sub_func_uint64_t_u_u(
|
||||
|
||||
target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
|
||||
|
||||
@g_57 = external dso_local global i16, align 2
|
||||
|
||||
; Function Attrs: nounwind
|
||||
define dso_local void @main() #0 {
|
||||
bb:
|
||||
call void @func_1()
|
||||
unreachable
|
||||
}
|
||||
|
||||
; Function Attrs: nounwind
|
||||
define dso_local void @func_1() #0 {
|
||||
bb:
|
||||
call void @func_25()
|
||||
unreachable
|
||||
}
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare dso_local void @safe_lshift_func_int16_t_s_u() #0
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare dso_local void @safe_mul_func_int8_t_s_s() #0
|
||||
|
||||
; Function Attrs: nounwind
|
||||
define dso_local void @func_25() #0 {
|
||||
bb:
|
||||
call void @func_50()
|
||||
unreachable
|
||||
}
|
||||
|
||||
; Function Attrs: nounwind
|
||||
define dso_local void @func_50() #0 {
|
||||
bb:
|
||||
call void @func_76(i8 signext undef)
|
||||
unreachable
|
||||
}
|
||||
|
||||
; Function Attrs: nounwind
|
||||
define dso_local void @safe_lshift_func_uint8_t_u_u() #0 {
|
||||
bb:
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare dso_local i64 @safe_sub_func_uint64_t_u_u() #0
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare dso_local void @safe_mod_func_uint64_t_u_u() #0
|
||||
|
||||
; Function Attrs: nounwind
|
||||
define dso_local void @func_76(i8 signext %arg) #0 {
|
||||
bb:
|
||||
%tmp = alloca i8, align 1
|
||||
%tmp1 = alloca i32, align 4
|
||||
%tmp2 = alloca i32, align 4
|
||||
store i8 %arg, i8* %tmp, align 1, !tbaa !1
|
||||
br label %bb3
|
||||
|
||||
bb3: ; preds = %bb29, %bb
|
||||
br label %bb4
|
||||
|
||||
bb4: ; preds = %bb28, %bb3
|
||||
%tmp5 = load i16, i16* @g_57, align 2, !tbaa !4
|
||||
%tmp6 = zext i16 %tmp5 to i32
|
||||
%tmp7 = icmp sgt i32 %tmp6, 56
|
||||
br i1 %tmp7, label %bb8, label %bb29
|
||||
|
||||
bb8: ; preds = %bb4
|
||||
%tmp9 = call i64 @safe_sub_func_uint64_t_u_u()
|
||||
%tmp10 = icmp ne i64 %tmp9, 0
|
||||
br i1 %tmp10, label %bb11, label %bb25
|
||||
|
||||
bb11: ; preds = %bb8
|
||||
store i32 26, i32* %tmp1, align 4, !tbaa !6
|
||||
br label %bb12
|
||||
|
||||
bb12: ; preds = %bb15, %bb11
|
||||
%tmp13 = load i32, i32* %tmp1, align 4, !tbaa !6
|
||||
%tmp14 = icmp ne i32 %tmp13, 12
|
||||
br i1 %tmp14, label %bb15, label %bb18
|
||||
|
||||
bb15: ; preds = %bb12
|
||||
store i8 -23, i8* %tmp, align 1, !tbaa !1
|
||||
call void @safe_mod_func_uint64_t_u_u()
|
||||
%tmp16 = load i32, i32* %tmp1, align 4, !tbaa !6
|
||||
%tmp17 = add nsw i32 %tmp16, -1
|
||||
store i32 %tmp17, i32* %tmp1, align 4, !tbaa !6
|
||||
br label %bb12
|
||||
|
||||
bb18: ; preds = %bb12
|
||||
%tmp19 = load i8, i8* %tmp, align 1, !tbaa !1
|
||||
%tmp20 = icmp ne i8 %tmp19, 0
|
||||
br i1 %tmp20, label %bb21, label %bb22
|
||||
|
||||
bb21: ; preds = %bb18
|
||||
store i32 7, i32* %tmp2, align 4
|
||||
br label %bb22
|
||||
|
||||
bb22: ; preds = %bb21, %bb18
|
||||
%tmp23 = load i32, i32* %tmp2, align 4
|
||||
%tmp24 = icmp eq i32 %tmp23, 0
|
||||
br i1 %tmp24, label %bb26, label %bb27
|
||||
|
||||
bb25: ; preds = %bb8
|
||||
call void @safe_lshift_func_int16_t_s_u()
|
||||
store i32 0, i32* %tmp2, align 4
|
||||
switch i32 undef, label %bb30 [
|
||||
i32 0, label %bb26
|
||||
i32 7, label %bb28
|
||||
]
|
||||
|
||||
bb26: ; preds = %bb25, %bb22
|
||||
call void @safe_mul_func_int8_t_s_s()
|
||||
br label %bb27
|
||||
|
||||
bb27: ; preds = %bb26, %bb22
|
||||
switch i32 undef, label %bb30 [
|
||||
i32 0, label %bb28
|
||||
i32 7, label %bb28
|
||||
]
|
||||
|
||||
bb28: ; preds = %bb27, %bb27, %bb25
|
||||
br label %bb4
|
||||
|
||||
bb29: ; preds = %bb4
|
||||
br i1 undef, label %bb3, label %bb30
|
||||
|
||||
bb30: ; preds = %bb29, %bb27, %bb25
|
||||
ret void
|
||||
}
|
||||
|
||||
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="z13" "target-features"="+transactional-execution,+vector" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
||||
|
||||
!1 = !{!2, !2, i64 0}
|
||||
!2 = !{!"omnipotent char", !3, i64 0}
|
||||
!3 = !{!"Simple C/C++ TBAA"}
|
||||
!4 = !{!5, !5, i64 0}
|
||||
!5 = !{!"short", !2, i64 0}
|
||||
!6 = !{!7, !7, i64 0}
|
||||
!7 = !{!"int", !2, i64 0}
|
Loading…
Reference in New Issue