Colin LeMahieu | bb71f7d | 2015-06-17 20:29:33 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=hexagon -O3 < %s | FileCheck %s |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 2 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 3 | ; CHECK-LABEL: @test_pos1_ir_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 4 | ; CHECK: loop0 |
| 5 | ; a < b |
| 6 | define void @test_pos1_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 7 | entry: |
| 8 | %cmp3 = icmp slt i32 8531, %b |
| 9 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 10 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 11 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 12 | br label %for.body |
| 13 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 14 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 15 | %i.04 = phi i32 [ 8531, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 16 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 17 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 18 | %conv = zext i8 %0 to i32 |
| 19 | %add = add nsw i32 %conv, 1 |
| 20 | %conv1 = trunc i32 %add to i8 |
| 21 | store i8 %conv1, i8* %arrayidx, align 1 |
| 22 | %inc = add nsw i32 %i.04, 1 |
| 23 | %cmp = icmp slt i32 %inc, %b |
| 24 | br i1 %cmp, label %for.body, label %for.end |
| 25 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 26 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 27 | ret void |
| 28 | } |
| 29 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 30 | ; CHECK-LABEL: @test_pos2_ir_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 31 | ; CHECK: loop0 |
| 32 | ; a < b |
| 33 | define void @test_pos2_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 34 | entry: |
| 35 | %cmp3 = icmp slt i32 9152, %b |
| 36 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 37 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 38 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 39 | br label %for.body |
| 40 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 41 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 42 | %i.04 = phi i32 [ 9152, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 43 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 44 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 45 | %conv = zext i8 %0 to i32 |
| 46 | %add = add nsw i32 %conv, 1 |
| 47 | %conv1 = trunc i32 %add to i8 |
| 48 | store i8 %conv1, i8* %arrayidx, align 1 |
| 49 | %inc = add nsw i32 %i.04, 2 |
| 50 | %cmp = icmp slt i32 %inc, %b |
| 51 | br i1 %cmp, label %for.body, label %for.end |
| 52 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 53 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 54 | ret void |
| 55 | } |
| 56 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 57 | ; CHECK-LABEL: @test_pos4_ir_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 58 | ; CHECK: loop0 |
| 59 | ; a < b |
| 60 | define void @test_pos4_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 61 | entry: |
| 62 | %cmp3 = icmp slt i32 18851, %b |
| 63 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 64 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 65 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 66 | br label %for.body |
| 67 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 68 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 69 | %i.04 = phi i32 [ 18851, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 70 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 71 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 72 | %conv = zext i8 %0 to i32 |
| 73 | %add = add nsw i32 %conv, 1 |
| 74 | %conv1 = trunc i32 %add to i8 |
| 75 | store i8 %conv1, i8* %arrayidx, align 1 |
| 76 | %inc = add nsw i32 %i.04, 4 |
| 77 | %cmp = icmp slt i32 %inc, %b |
| 78 | br i1 %cmp, label %for.body, label %for.end |
| 79 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 80 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 81 | ret void |
| 82 | } |
| 83 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 84 | ; CHECK-LABEL: @test_pos8_ir_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 85 | ; CHECK: loop0 |
| 86 | ; a < b |
| 87 | define void @test_pos8_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 88 | entry: |
| 89 | %cmp3 = icmp slt i32 25466, %b |
| 90 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 91 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 92 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 93 | br label %for.body |
| 94 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 95 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 96 | %i.04 = phi i32 [ 25466, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 97 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 98 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 99 | %conv = zext i8 %0 to i32 |
| 100 | %add = add nsw i32 %conv, 1 |
| 101 | %conv1 = trunc i32 %add to i8 |
| 102 | store i8 %conv1, i8* %arrayidx, align 1 |
| 103 | %inc = add nsw i32 %i.04, 8 |
| 104 | %cmp = icmp slt i32 %inc, %b |
| 105 | br i1 %cmp, label %for.body, label %for.end |
| 106 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 107 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 108 | ret void |
| 109 | } |
| 110 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 111 | ; CHECK-LABEL: @test_pos16_ir_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 112 | ; CHECK: loop0 |
| 113 | ; a < b |
| 114 | define void @test_pos16_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 115 | entry: |
| 116 | %cmp3 = icmp slt i32 9295, %b |
| 117 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 118 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 119 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 120 | br label %for.body |
| 121 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 122 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 123 | %i.04 = phi i32 [ 9295, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 124 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 125 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 126 | %conv = zext i8 %0 to i32 |
| 127 | %add = add nsw i32 %conv, 1 |
| 128 | %conv1 = trunc i32 %add to i8 |
| 129 | store i8 %conv1, i8* %arrayidx, align 1 |
| 130 | %inc = add nsw i32 %i.04, 16 |
| 131 | %cmp = icmp slt i32 %inc, %b |
| 132 | br i1 %cmp, label %for.body, label %for.end |
| 133 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 134 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 135 | ret void |
| 136 | } |
| 137 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 138 | ; CHECK-LABEL: @test_pos1_ri_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 139 | ; CHECK: loop0 |
| 140 | ; a < b |
| 141 | define void @test_pos1_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 142 | entry: |
| 143 | %cmp3 = icmp slt i32 %a, 31236 |
| 144 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 145 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 146 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 147 | br label %for.body |
| 148 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 149 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 150 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 151 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 152 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 153 | %conv = zext i8 %0 to i32 |
| 154 | %add = add nsw i32 %conv, 1 |
| 155 | %conv1 = trunc i32 %add to i8 |
| 156 | store i8 %conv1, i8* %arrayidx, align 1 |
| 157 | %inc = add nsw i32 %i.04, 1 |
| 158 | %cmp = icmp slt i32 %inc, 31236 |
| 159 | br i1 %cmp, label %for.body, label %for.end |
| 160 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 161 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 162 | ret void |
| 163 | } |
| 164 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 165 | ; CHECK-LABEL: @test_pos2_ri_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 166 | ; CHECK: loop0 |
| 167 | ; a < b |
| 168 | define void @test_pos2_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 169 | entry: |
| 170 | %cmp3 = icmp slt i32 %a, 22653 |
| 171 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 172 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 173 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 174 | br label %for.body |
| 175 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 176 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 177 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 178 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 179 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 180 | %conv = zext i8 %0 to i32 |
| 181 | %add = add nsw i32 %conv, 1 |
| 182 | %conv1 = trunc i32 %add to i8 |
| 183 | store i8 %conv1, i8* %arrayidx, align 1 |
| 184 | %inc = add nsw i32 %i.04, 2 |
| 185 | %cmp = icmp slt i32 %inc, 22653 |
| 186 | br i1 %cmp, label %for.body, label %for.end |
| 187 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 188 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 189 | ret void |
| 190 | } |
| 191 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 192 | ; CHECK-LABEL: @test_pos4_ri_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 193 | ; CHECK: loop0 |
| 194 | ; a < b |
| 195 | define void @test_pos4_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 196 | entry: |
| 197 | %cmp3 = icmp slt i32 %a, 1431 |
| 198 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 199 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 200 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 201 | br label %for.body |
| 202 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 203 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 204 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 205 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 206 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 207 | %conv = zext i8 %0 to i32 |
| 208 | %add = add nsw i32 %conv, 1 |
| 209 | %conv1 = trunc i32 %add to i8 |
| 210 | store i8 %conv1, i8* %arrayidx, align 1 |
| 211 | %inc = add nsw i32 %i.04, 4 |
| 212 | %cmp = icmp slt i32 %inc, 1431 |
| 213 | br i1 %cmp, label %for.body, label %for.end |
| 214 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 215 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 216 | ret void |
| 217 | } |
| 218 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 219 | ; CHECK-LABEL: @test_pos8_ri_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 220 | ; CHECK: loop0 |
| 221 | ; a < b |
| 222 | define void @test_pos8_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 223 | entry: |
| 224 | %cmp3 = icmp slt i32 %a, 22403 |
| 225 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 226 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 227 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 228 | br label %for.body |
| 229 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 230 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 231 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 232 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 233 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 234 | %conv = zext i8 %0 to i32 |
| 235 | %add = add nsw i32 %conv, 1 |
| 236 | %conv1 = trunc i32 %add to i8 |
| 237 | store i8 %conv1, i8* %arrayidx, align 1 |
| 238 | %inc = add nsw i32 %i.04, 8 |
| 239 | %cmp = icmp slt i32 %inc, 22403 |
| 240 | br i1 %cmp, label %for.body, label %for.end |
| 241 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 242 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 243 | ret void |
| 244 | } |
| 245 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 246 | ; CHECK-LABEL: @test_pos16_ri_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 247 | ; CHECK: loop0 |
| 248 | ; a < b |
| 249 | define void @test_pos16_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 250 | entry: |
| 251 | %cmp3 = icmp slt i32 %a, 21715 |
| 252 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 253 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 254 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 255 | br label %for.body |
| 256 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 257 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 258 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 259 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 260 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 261 | %conv = zext i8 %0 to i32 |
| 262 | %add = add nsw i32 %conv, 1 |
| 263 | %conv1 = trunc i32 %add to i8 |
| 264 | store i8 %conv1, i8* %arrayidx, align 1 |
| 265 | %inc = add nsw i32 %i.04, 16 |
| 266 | %cmp = icmp slt i32 %inc, 21715 |
| 267 | br i1 %cmp, label %for.body, label %for.end |
| 268 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 269 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 270 | ret void |
| 271 | } |
| 272 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 273 | ; CHECK-LABEL: @test_pos1_rr_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 274 | ; CHECK: loop0 |
| 275 | ; a < b |
| 276 | define void @test_pos1_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 277 | entry: |
| 278 | %cmp3 = icmp slt i32 %a, %b |
| 279 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 280 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 281 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 282 | br label %for.body |
| 283 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 284 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 285 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 286 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 287 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 288 | %conv = zext i8 %0 to i32 |
| 289 | %add = add nsw i32 %conv, 1 |
| 290 | %conv1 = trunc i32 %add to i8 |
| 291 | store i8 %conv1, i8* %arrayidx, align 1 |
| 292 | %inc = add nsw i32 %i.04, 1 |
| 293 | %cmp = icmp slt i32 %inc, %b |
| 294 | br i1 %cmp, label %for.body, label %for.end |
| 295 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 296 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 297 | ret void |
| 298 | } |
| 299 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 300 | ; CHECK-LABEL: @test_pos2_rr_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 301 | ; CHECK: loop0 |
| 302 | ; a < b |
| 303 | define void @test_pos2_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 304 | entry: |
| 305 | %cmp3 = icmp slt i32 %a, %b |
| 306 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 307 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 308 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 309 | br label %for.body |
| 310 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 311 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 312 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 313 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 314 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 315 | %conv = zext i8 %0 to i32 |
| 316 | %add = add nsw i32 %conv, 1 |
| 317 | %conv1 = trunc i32 %add to i8 |
| 318 | store i8 %conv1, i8* %arrayidx, align 1 |
| 319 | %inc = add nsw i32 %i.04, 2 |
| 320 | %cmp = icmp slt i32 %inc, %b |
| 321 | br i1 %cmp, label %for.body, label %for.end |
| 322 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 323 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 324 | ret void |
| 325 | } |
| 326 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 327 | ; CHECK-LABEL: @test_pos4_rr_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 328 | ; CHECK: loop0 |
| 329 | ; a < b |
| 330 | define void @test_pos4_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 331 | entry: |
| 332 | %cmp3 = icmp slt i32 %a, %b |
| 333 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 334 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 335 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 336 | br label %for.body |
| 337 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 338 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 339 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 340 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 341 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 342 | %conv = zext i8 %0 to i32 |
| 343 | %add = add nsw i32 %conv, 1 |
| 344 | %conv1 = trunc i32 %add to i8 |
| 345 | store i8 %conv1, i8* %arrayidx, align 1 |
| 346 | %inc = add nsw i32 %i.04, 4 |
| 347 | %cmp = icmp slt i32 %inc, %b |
| 348 | br i1 %cmp, label %for.body, label %for.end |
| 349 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 350 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 351 | ret void |
| 352 | } |
| 353 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 354 | ; CHECK-LABEL: @test_pos8_rr_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 355 | ; CHECK: loop0 |
| 356 | ; a < b |
| 357 | define void @test_pos8_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 358 | entry: |
| 359 | %cmp3 = icmp slt i32 %a, %b |
| 360 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 361 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 362 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 363 | br label %for.body |
| 364 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 365 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 366 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 367 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 368 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 369 | %conv = zext i8 %0 to i32 |
| 370 | %add = add nsw i32 %conv, 1 |
| 371 | %conv1 = trunc i32 %add to i8 |
| 372 | store i8 %conv1, i8* %arrayidx, align 1 |
| 373 | %inc = add nsw i32 %i.04, 8 |
| 374 | %cmp = icmp slt i32 %inc, %b |
| 375 | br i1 %cmp, label %for.body, label %for.end |
| 376 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 377 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 378 | ret void |
| 379 | } |
| 380 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 381 | ; CHECK-LABEL: @test_pos16_rr_slt |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 382 | ; CHECK: loop0 |
| 383 | ; a < b |
| 384 | define void @test_pos16_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 385 | entry: |
| 386 | %cmp3 = icmp slt i32 %a, %b |
| 387 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 388 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 389 | for.body.lr.ph: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 390 | br label %for.body |
| 391 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 392 | for.body: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 393 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 394 | %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 395 | %0 = load i8, i8* %arrayidx, align 1 |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 396 | %conv = zext i8 %0 to i32 |
| 397 | %add = add nsw i32 %conv, 1 |
| 398 | %conv1 = trunc i32 %add to i8 |
| 399 | store i8 %conv1, i8* %arrayidx, align 1 |
| 400 | %inc = add nsw i32 %i.04, 16 |
| 401 | %cmp = icmp slt i32 %inc, %b |
| 402 | br i1 %cmp, label %for.body, label %for.end |
| 403 | |
Brendon Cahoon | bece8ed | 2015-05-08 20:18:21 +0000 | [diff] [blame] | 404 | for.end: |
Krzysztof Parzyszek | 9a278f1 | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 405 | ret void |
| 406 | } |
| 407 | |
| 408 | |
| 409 | |