llvm.org GIT mirror llvm / 0d77b9c
Extract the broken part of XFAILed test into its own file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155081 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 7 years ago
2 changed file(s) with 93 addition(s) and 94 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt -O3 -S %s | FileCheck %s
1 ; XFAIL: *
2
3 declare i32 @doo(...)
4
5 ; PR6627 - This whole nasty sequence should be flattened down to a single
6 ; 32-bit comparison.
7 define void @test2(i8* %arrayidx) nounwind ssp {
8 entry:
9 %xx = bitcast i8* %arrayidx to i32*
10 %x1 = load i32* %xx, align 4
11 %tmp = trunc i32 %x1 to i8
12 %conv = zext i8 %tmp to i32
13 %cmp = icmp eq i32 %conv, 127
14 br i1 %cmp, label %land.lhs.true, label %if.end
15
16 land.lhs.true: ; preds = %entry
17 %arrayidx4 = getelementptr inbounds i8* %arrayidx, i64 1
18 %tmp5 = load i8* %arrayidx4, align 1
19 %conv6 = zext i8 %tmp5 to i32
20 %cmp7 = icmp eq i32 %conv6, 69
21 br i1 %cmp7, label %land.lhs.true9, label %if.end
22
23 land.lhs.true9: ; preds = %land.lhs.true
24 %arrayidx12 = getelementptr inbounds i8* %arrayidx, i64 2
25 %tmp13 = load i8* %arrayidx12, align 1
26 %conv14 = zext i8 %tmp13 to i32
27 %cmp15 = icmp eq i32 %conv14, 76
28 br i1 %cmp15, label %land.lhs.true17, label %if.end
29
30 land.lhs.true17: ; preds = %land.lhs.true9
31 %arrayidx20 = getelementptr inbounds i8* %arrayidx, i64 3
32 %tmp21 = load i8* %arrayidx20, align 1
33 %conv22 = zext i8 %tmp21 to i32
34 %cmp23 = icmp eq i32 %conv22, 70
35 br i1 %cmp23, label %if.then, label %if.end
36
37 if.then: ; preds = %land.lhs.true17
38 %call25 = call i32 (...)* @doo()
39 br label %if.end
40
41 if.end:
42 ret void
43
44 ; CHECK: @test2
45 ; CHECK: %x1 = load i32* %xx, align 4
46 ; CHECK-NEXT: icmp eq i32 %x1, 1179403647
47 ; CHECK-NEXT: br i1 {{.*}}, label %if.then, label %if.end
48 }
49
50 ; PR6627 - This should all be flattened down to one compare. This is the same
51 ; as test2, except that the initial load is done as an i8 instead of i32, thus
52 ; requiring widening.
53 define void @test2a(i8* %arrayidx) nounwind ssp {
54 entry:
55 %x1 = load i8* %arrayidx, align 4
56 %conv = zext i8 %x1 to i32
57 %cmp = icmp eq i32 %conv, 127
58 br i1 %cmp, label %land.lhs.true, label %if.end
59
60 land.lhs.true: ; preds = %entry
61 %arrayidx4 = getelementptr inbounds i8* %arrayidx, i64 1
62 %tmp5 = load i8* %arrayidx4, align 1
63 %conv6 = zext i8 %tmp5 to i32
64 %cmp7 = icmp eq i32 %conv6, 69
65 br i1 %cmp7, label %land.lhs.true9, label %if.end
66
67 land.lhs.true9: ; preds = %land.lhs.true
68 %arrayidx12 = getelementptr inbounds i8* %arrayidx, i64 2
69 %tmp13 = load i8* %arrayidx12, align 1
70 %conv14 = zext i8 %tmp13 to i32
71 %cmp15 = icmp eq i32 %conv14, 76
72 br i1 %cmp15, label %land.lhs.true17, label %if.end
73
74 land.lhs.true17: ; preds = %land.lhs.true9
75 %arrayidx20 = getelementptr inbounds i8* %arrayidx, i64 3
76 %tmp21 = load i8* %arrayidx20, align 1
77 %conv22 = zext i8 %tmp21 to i32
78 %cmp23 = icmp eq i32 %conv22, 70
79 br i1 %cmp23, label %if.then, label %if.end
80
81 if.then: ; preds = %land.lhs.true17
82 %call25 = call i32 (...)* @doo()
83 br label %if.end
84
85 if.end:
86 ret void
87
88 ; CHECK: @test2a
89 ; CHECK: %x1 = load i32* {{.*}}, align 4
90 ; CHECK-NEXT: icmp eq i32 %x1, 1179403647
91 ; CHECK-NEXT: br i1 {{.*}}, label %if.then, label %if.end
92 }
0 ; RUN: opt -O3 -S %s | FileCheck %s
1 ; XFAIL: *
21
32 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
43 target triple = "x86_64-apple-macosx10.6.7"
2221 ; CHECK: @test1
2322 ; CHECK-NEXT: ret void
2423 }
25
26
27 ; PR6627 - This whole nasty sequence should be flattened down to a single
28 ; 32-bit comparison.
29 define void @test2(i8* %arrayidx) nounwind ssp {
30 entry:
31 %xx = bitcast i8* %arrayidx to i32*
32 %x1 = load i32* %xx, align 4
33 %tmp = trunc i32 %x1 to i8
34 %conv = zext i8 %tmp to i32
35 %cmp = icmp eq i32 %conv, 127
36 br i1 %cmp, label %land.lhs.true, label %if.end
37
38 land.lhs.true: ; preds = %entry
39 %arrayidx4 = getelementptr inbounds i8* %arrayidx, i64 1
40 %tmp5 = load i8* %arrayidx4, align 1
41 %conv6 = zext i8 %tmp5 to i32
42 %cmp7 = icmp eq i32 %conv6, 69
43 br i1 %cmp7, label %land.lhs.true9, label %if.end
44
45 land.lhs.true9: ; preds = %land.lhs.true
46 %arrayidx12 = getelementptr inbounds i8* %arrayidx, i64 2
47 %tmp13 = load i8* %arrayidx12, align 1
48 %conv14 = zext i8 %tmp13 to i32
49 %cmp15 = icmp eq i32 %conv14, 76
50 br i1 %cmp15, label %land.lhs.true17, label %if.end
51
52 land.lhs.true17: ; preds = %land.lhs.true9
53 %arrayidx20 = getelementptr inbounds i8* %arrayidx, i64 3
54 %tmp21 = load i8* %arrayidx20, align 1
55 %conv22 = zext i8 %tmp21 to i32
56 %cmp23 = icmp eq i32 %conv22, 70
57 br i1 %cmp23, label %if.then, label %if.end
58
59 if.then: ; preds = %land.lhs.true17
60 %call25 = call i32 (...)* @doo()
61 br label %if.end
62
63 if.end:
64 ret void
65
66 ; CHECK: @test2
67 ; CHECK: %x1 = load i32* %xx, align 4
68 ; CHECK-NEXT: icmp eq i32 %x1, 1179403647
69 ; CHECK-NEXT: br i1 {{.*}}, label %if.then, label %if.end
70 }
71
72 declare i32 @doo(...)
73
74 ; PR6627 - This should all be flattened down to one compare. This is the same
75 ; as test2, except that the initial load is done as an i8 instead of i32, thus
76 ; requiring widening.
77 define void @test2a(i8* %arrayidx) nounwind ssp {
78 entry:
79 %x1 = load i8* %arrayidx, align 4
80 %conv = zext i8 %x1 to i32
81 %cmp = icmp eq i32 %conv, 127
82 br i1 %cmp, label %land.lhs.true, label %if.end
83
84 land.lhs.true: ; preds = %entry
85 %arrayidx4 = getelementptr inbounds i8* %arrayidx, i64 1
86 %tmp5 = load i8* %arrayidx4, align 1
87 %conv6 = zext i8 %tmp5 to i32
88 %cmp7 = icmp eq i32 %conv6, 69
89 br i1 %cmp7, label %land.lhs.true9, label %if.end
90
91 land.lhs.true9: ; preds = %land.lhs.true
92 %arrayidx12 = getelementptr inbounds i8* %arrayidx, i64 2
93 %tmp13 = load i8* %arrayidx12, align 1
94 %conv14 = zext i8 %tmp13 to i32
95 %cmp15 = icmp eq i32 %conv14, 76
96 br i1 %cmp15, label %land.lhs.true17, label %if.end
97
98 land.lhs.true17: ; preds = %land.lhs.true9
99 %arrayidx20 = getelementptr inbounds i8* %arrayidx, i64 3
100 %tmp21 = load i8* %arrayidx20, align 1
101 %conv22 = zext i8 %tmp21 to i32
102 %cmp23 = icmp eq i32 %conv22, 70
103 br i1 %cmp23, label %if.then, label %if.end
104
105 if.then: ; preds = %land.lhs.true17
106 %call25 = call i32 (...)* @doo()
107 br label %if.end
108
109 if.end:
110 ret void
111
112 ; CHECK: @test2a
113 ; CHECK: %x1 = load i32* {{.*}}, align 4
114 ; CHECK-NEXT: icmp eq i32 %x1, 1179403647
115 ; CHECK-NEXT: br i1 {{.*}}, label %if.then, label %if.end
116 }
117