Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 1 | ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py |
| 2 | ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s |
| 3 | |
| 4 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
| 5 | target triple = "x86_64-unknown-linux-gnu" |
| 6 | |
| 7 | define void @unsimplified_and1(i32 %n) { |
| 8 | ; CHECK-LABEL: 'unsimplified_and1' |
| 9 | ; CHECK-NEXT: Classifying expressions for: @unsimplified_and1 |
| 10 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 11 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: %n LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 12 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 13 | ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: (1 + %n) LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 14 | ; CHECK-NEXT: %and = and i1 %becond, true |
| 15 | ; CHECK-NEXT: --> %becond U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 16 | ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 17 | ; CHECK-NEXT: Loop %loop: backedge-taken count is %n |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 18 | ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 19 | ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n |
| 20 | ; CHECK-NEXT: Predicates: |
| 21 | ; CHECK: Loop %loop: Trip multiple is 1 |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 22 | ; |
| 23 | entry: |
| 24 | br label %loop |
| 25 | |
| 26 | loop: |
| 27 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 28 | %iv.inc = add nsw i32 %iv, 1 |
| 29 | %becond = icmp ule i32 %iv.inc, %n |
| 30 | %and = and i1 %becond, true |
| 31 | br i1 %and, label %loop, label %leave |
| 32 | |
| 33 | leave: |
| 34 | ret void |
| 35 | } |
| 36 | |
| 37 | define void @unsimplified_and2(i32 %n) { |
| 38 | ; CHECK-LABEL: 'unsimplified_and2' |
| 39 | ; CHECK-NEXT: Classifying expressions for: @unsimplified_and2 |
| 40 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 41 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: %n LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 42 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 43 | ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: (1 + %n) LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 44 | ; CHECK-NEXT: %and = and i1 true, %becond |
| 45 | ; CHECK-NEXT: --> %and U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 46 | ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and2 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 47 | ; CHECK-NEXT: Loop %loop: backedge-taken count is %n |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 48 | ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 49 | ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n |
| 50 | ; CHECK-NEXT: Predicates: |
| 51 | ; CHECK: Loop %loop: Trip multiple is 1 |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 52 | ; |
| 53 | entry: |
| 54 | br label %loop |
| 55 | |
| 56 | loop: |
| 57 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 58 | %iv.inc = add nsw i32 %iv, 1 |
| 59 | %becond = icmp ule i32 %iv.inc, %n |
| 60 | %and = and i1 true, %becond |
| 61 | br i1 %and, label %loop, label %leave |
| 62 | |
| 63 | leave: |
| 64 | ret void |
| 65 | } |
| 66 | |
| 67 | define void @unsimplified_and3(i32 %n) { |
| 68 | ; CHECK-LABEL: 'unsimplified_and3' |
| 69 | ; CHECK-NEXT: Classifying expressions for: @unsimplified_and3 |
| 70 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 71 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,1) S: [0,1) Exits: 0 LoopDispositions: { %loop: Computable } |
| 72 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
| 73 | ; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%loop> U: [1,2) S: [1,2) Exits: 1 LoopDispositions: { %loop: Computable } |
| 74 | ; CHECK-NEXT: %and = and i1 false, %becond |
| 75 | ; CHECK-NEXT: --> %and U: [0,-1) S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 76 | ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and3 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 77 | ; CHECK-NEXT: Loop %loop: backedge-taken count is false |
| 78 | ; CHECK-NEXT: Loop %loop: max backedge-taken count is false |
| 79 | ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is false |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 80 | ; CHECK-NEXT: Predicates: |
| 81 | ; CHECK: Loop %loop: Trip multiple is 1 |
| 82 | ; |
| 83 | entry: |
| 84 | br label %loop |
| 85 | |
| 86 | loop: |
| 87 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 88 | %iv.inc = add nsw i32 %iv, 1 |
| 89 | %becond = icmp ule i32 %iv.inc, %n |
| 90 | %and = and i1 false, %becond |
| 91 | br i1 %and, label %loop, label %leave |
| 92 | |
| 93 | leave: |
| 94 | ret void |
| 95 | } |
| 96 | |
| 97 | define void @unsimplified_and4(i32 %n) { |
| 98 | ; CHECK-LABEL: 'unsimplified_and4' |
| 99 | ; CHECK-NEXT: Classifying expressions for: @unsimplified_and4 |
| 100 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 101 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,1) S: [0,1) Exits: 0 LoopDispositions: { %loop: Computable } |
| 102 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
| 103 | ; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%loop> U: [1,2) S: [1,2) Exits: 1 LoopDispositions: { %loop: Computable } |
| 104 | ; CHECK-NEXT: %and = and i1 %becond, false |
| 105 | ; CHECK-NEXT: --> false U: [0,-1) S: [0,-1) Exits: false LoopDispositions: { %loop: Invariant } |
| 106 | ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and4 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 107 | ; CHECK-NEXT: Loop %loop: backedge-taken count is false |
| 108 | ; CHECK-NEXT: Loop %loop: max backedge-taken count is false |
| 109 | ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is false |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 110 | ; CHECK-NEXT: Predicates: |
| 111 | ; CHECK: Loop %loop: Trip multiple is 1 |
| 112 | ; |
| 113 | entry: |
| 114 | br label %loop |
| 115 | |
| 116 | loop: |
| 117 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 118 | %iv.inc = add nsw i32 %iv, 1 |
| 119 | %becond = icmp ule i32 %iv.inc, %n |
| 120 | %and = and i1 %becond, false |
| 121 | br i1 %and, label %loop, label %leave |
| 122 | |
| 123 | leave: |
| 124 | ret void |
| 125 | } |
| 126 | |
| 127 | define void @unsimplified_or1(i32 %n) { |
| 128 | ; CHECK-LABEL: 'unsimplified_or1' |
| 129 | ; CHECK-NEXT: Classifying expressions for: @unsimplified_or1 |
| 130 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 131 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: <<Unknown>> LoopDispositions: { %loop: Computable } |
| 132 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
| 133 | ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: <<Unknown>> LoopDispositions: { %loop: Computable } |
| 134 | ; CHECK-NEXT: %or = or i1 %becond, true |
| 135 | ; CHECK-NEXT: --> %or U: [-1,0) S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 136 | ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or1 |
| 137 | ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. |
| 138 | ; CHECK-NEXT: Loop %loop: Unpredictable max backedge-taken count. |
| 139 | ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count. |
| 140 | ; |
| 141 | entry: |
| 142 | br label %loop |
| 143 | |
| 144 | loop: |
| 145 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 146 | %iv.inc = add nsw i32 %iv, 1 |
| 147 | %becond = icmp ule i32 %iv.inc, %n |
| 148 | %or = or i1 %becond, true |
| 149 | br i1 %or, label %loop, label %leave |
| 150 | |
| 151 | leave: |
| 152 | ret void |
| 153 | } |
| 154 | |
| 155 | define void @unsimplified_or2(i32 %n) { |
| 156 | ; CHECK-LABEL: 'unsimplified_or2' |
| 157 | ; CHECK-NEXT: Classifying expressions for: @unsimplified_or2 |
| 158 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 159 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: <<Unknown>> LoopDispositions: { %loop: Computable } |
| 160 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
| 161 | ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: <<Unknown>> LoopDispositions: { %loop: Computable } |
| 162 | ; CHECK-NEXT: %or = or i1 true, %becond |
| 163 | ; CHECK-NEXT: --> %or U: [-1,0) S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 164 | ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or2 |
| 165 | ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. |
| 166 | ; CHECK-NEXT: Loop %loop: Unpredictable max backedge-taken count. |
| 167 | ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count. |
| 168 | ; |
| 169 | entry: |
| 170 | br label %loop |
| 171 | |
| 172 | loop: |
| 173 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 174 | %iv.inc = add nsw i32 %iv, 1 |
| 175 | %becond = icmp ule i32 %iv.inc, %n |
| 176 | %or = or i1 true, %becond |
| 177 | br i1 %or, label %loop, label %leave |
| 178 | |
| 179 | leave: |
| 180 | ret void |
| 181 | } |
| 182 | |
| 183 | define void @unsimplified_or3(i32 %n) { |
| 184 | ; CHECK-LABEL: 'unsimplified_or3' |
| 185 | ; CHECK-NEXT: Classifying expressions for: @unsimplified_or3 |
| 186 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 187 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: %n LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 188 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 189 | ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: (1 + %n) LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 190 | ; CHECK-NEXT: %or = or i1 false, %becond |
| 191 | ; CHECK-NEXT: --> %or U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 192 | ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or3 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 193 | ; CHECK-NEXT: Loop %loop: backedge-taken count is %n |
| 194 | ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1 |
| 195 | ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n |
| 196 | ; CHECK-NEXT: Predicates: |
| 197 | ; CHECK: Loop %loop: Trip multiple is 1 |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 198 | ; |
| 199 | entry: |
| 200 | br label %loop |
| 201 | |
| 202 | loop: |
| 203 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 204 | %iv.inc = add nsw i32 %iv, 1 |
| 205 | %becond = icmp ule i32 %iv.inc, %n |
| 206 | %or = or i1 false, %becond |
| 207 | br i1 %or, label %loop, label %leave |
| 208 | |
| 209 | leave: |
| 210 | ret void |
| 211 | } |
| 212 | |
| 213 | define void @unsimplified_or4(i32 %n) { |
| 214 | ; CHECK-LABEL: 'unsimplified_or4' |
| 215 | ; CHECK-NEXT: Classifying expressions for: @unsimplified_or4 |
| 216 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 217 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: %n LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 218 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 219 | ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: (1 + %n) LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 220 | ; CHECK-NEXT: %or = or i1 %becond, false |
| 221 | ; CHECK-NEXT: --> %becond U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 222 | ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or4 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 223 | ; CHECK-NEXT: Loop %loop: backedge-taken count is %n |
| 224 | ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1 |
| 225 | ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n |
| 226 | ; CHECK-NEXT: Predicates: |
| 227 | ; CHECK: Loop %loop: Trip multiple is 1 |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 228 | ; |
| 229 | entry: |
| 230 | br label %loop |
| 231 | |
| 232 | loop: |
| 233 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 234 | %iv.inc = add nsw i32 %iv, 1 |
| 235 | %becond = icmp ule i32 %iv.inc, %n |
| 236 | %or = or i1 %becond, false |
| 237 | br i1 %or, label %loop, label %leave |
| 238 | |
| 239 | leave: |
| 240 | ret void |
| 241 | } |
| 242 | |
| 243 | define void @reversed_and1(i32 %n) { |
| 244 | ; CHECK-LABEL: 'reversed_and1' |
| 245 | ; CHECK-NEXT: Classifying expressions for: @reversed_and1 |
| 246 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 247 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: %n LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 248 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 249 | ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: (1 + %n) LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 250 | ; CHECK-NEXT: %and = and i1 %becond, true |
| 251 | ; CHECK-NEXT: --> %becond U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 252 | ; CHECK-NEXT: Determining loop execution counts for: @reversed_and1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 253 | ; CHECK-NEXT: Loop %loop: backedge-taken count is %n |
| 254 | ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1 |
| 255 | ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n |
| 256 | ; CHECK-NEXT: Predicates: |
| 257 | ; CHECK: Loop %loop: Trip multiple is 1 |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 258 | ; |
| 259 | entry: |
| 260 | br label %loop |
| 261 | |
| 262 | loop: |
| 263 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 264 | %iv.inc = add nsw i32 %iv, 1 |
| 265 | %becond = icmp ugt i32 %iv.inc, %n |
| 266 | %and = and i1 %becond, true |
| 267 | br i1 %and, label %leave, label %loop |
| 268 | |
| 269 | leave: |
| 270 | ret void |
| 271 | } |
| 272 | |
| 273 | define void @reversed_and2(i32 %n) { |
| 274 | ; CHECK-LABEL: 'reversed_and2' |
| 275 | ; CHECK-NEXT: Classifying expressions for: @reversed_and2 |
| 276 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 277 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: %n LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 278 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 279 | ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: (1 + %n) LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 280 | ; CHECK-NEXT: %and = and i1 true, %becond |
| 281 | ; CHECK-NEXT: --> %and U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 282 | ; CHECK-NEXT: Determining loop execution counts for: @reversed_and2 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 283 | ; CHECK-NEXT: Loop %loop: backedge-taken count is %n |
| 284 | ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1 |
| 285 | ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n |
| 286 | ; CHECK-NEXT: Predicates: |
| 287 | ; CHECK: Loop %loop: Trip multiple is 1 |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 288 | ; |
| 289 | entry: |
| 290 | br label %loop |
| 291 | |
| 292 | loop: |
| 293 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 294 | %iv.inc = add nsw i32 %iv, 1 |
| 295 | %becond = icmp ugt i32 %iv.inc, %n |
| 296 | %and = and i1 true, %becond |
| 297 | br i1 %and, label %leave, label %loop |
| 298 | |
| 299 | leave: |
| 300 | ret void |
| 301 | } |
| 302 | |
| 303 | define void @reversed_and3(i32 %n) { |
| 304 | ; CHECK-LABEL: 'reversed_and3' |
| 305 | ; CHECK-NEXT: Classifying expressions for: @reversed_and3 |
| 306 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 307 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: <<Unknown>> LoopDispositions: { %loop: Computable } |
| 308 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
| 309 | ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: <<Unknown>> LoopDispositions: { %loop: Computable } |
| 310 | ; CHECK-NEXT: %and = and i1 false, %becond |
| 311 | ; CHECK-NEXT: --> %and U: [0,-1) S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 312 | ; CHECK-NEXT: Determining loop execution counts for: @reversed_and3 |
| 313 | ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. |
| 314 | ; CHECK-NEXT: Loop %loop: Unpredictable max backedge-taken count. |
| 315 | ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count. |
| 316 | ; |
| 317 | entry: |
| 318 | br label %loop |
| 319 | |
| 320 | loop: |
| 321 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 322 | %iv.inc = add nsw i32 %iv, 1 |
| 323 | %becond = icmp ugt i32 %iv.inc, %n |
| 324 | %and = and i1 false, %becond |
| 325 | br i1 %and, label %leave, label %loop |
| 326 | |
| 327 | leave: |
| 328 | ret void |
| 329 | } |
| 330 | |
| 331 | define void @reversed_and4(i32 %n) { |
| 332 | ; CHECK-LABEL: 'reversed_and4' |
| 333 | ; CHECK-NEXT: Classifying expressions for: @reversed_and4 |
| 334 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 335 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: <<Unknown>> LoopDispositions: { %loop: Computable } |
| 336 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
| 337 | ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: <<Unknown>> LoopDispositions: { %loop: Computable } |
| 338 | ; CHECK-NEXT: %and = and i1 %becond, false |
| 339 | ; CHECK-NEXT: --> false U: [0,-1) S: [0,-1) Exits: false LoopDispositions: { %loop: Invariant } |
| 340 | ; CHECK-NEXT: Determining loop execution counts for: @reversed_and4 |
| 341 | ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. |
| 342 | ; CHECK-NEXT: Loop %loop: Unpredictable max backedge-taken count. |
| 343 | ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count. |
| 344 | ; |
| 345 | entry: |
| 346 | br label %loop |
| 347 | |
| 348 | loop: |
| 349 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 350 | %iv.inc = add nsw i32 %iv, 1 |
| 351 | %becond = icmp ugt i32 %iv.inc, %n |
| 352 | %and = and i1 %becond, false |
| 353 | br i1 %and, label %leave, label %loop |
| 354 | |
| 355 | leave: |
| 356 | ret void |
| 357 | } |
| 358 | |
| 359 | define void @reversed_or1(i32 %n) { |
| 360 | ; CHECK-LABEL: 'reversed_or1' |
| 361 | ; CHECK-NEXT: Classifying expressions for: @reversed_or1 |
| 362 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 363 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,1) S: [0,1) Exits: 0 LoopDispositions: { %loop: Computable } |
| 364 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
| 365 | ; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%loop> U: [1,2) S: [1,2) Exits: 1 LoopDispositions: { %loop: Computable } |
| 366 | ; CHECK-NEXT: %or = or i1 %becond, true |
| 367 | ; CHECK-NEXT: --> %or U: [-1,0) S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 368 | ; CHECK-NEXT: Determining loop execution counts for: @reversed_or1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 369 | ; CHECK-NEXT: Loop %loop: backedge-taken count is false |
| 370 | ; CHECK-NEXT: Loop %loop: max backedge-taken count is false |
| 371 | ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is false |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 372 | ; CHECK-NEXT: Predicates: |
| 373 | ; CHECK: Loop %loop: Trip multiple is 1 |
| 374 | ; |
| 375 | entry: |
| 376 | br label %loop |
| 377 | |
| 378 | loop: |
| 379 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 380 | %iv.inc = add nsw i32 %iv, 1 |
| 381 | %becond = icmp ugt i32 %iv.inc, %n |
| 382 | %or = or i1 %becond, true |
| 383 | br i1 %or, label %leave, label %loop |
| 384 | |
| 385 | leave: |
| 386 | ret void |
| 387 | } |
| 388 | |
| 389 | define void @reversed_or2(i32 %n) { |
| 390 | ; CHECK-LABEL: 'reversed_or2' |
| 391 | ; CHECK-NEXT: Classifying expressions for: @reversed_or2 |
| 392 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 393 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,1) S: [0,1) Exits: 0 LoopDispositions: { %loop: Computable } |
| 394 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
| 395 | ; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%loop> U: [1,2) S: [1,2) Exits: 1 LoopDispositions: { %loop: Computable } |
| 396 | ; CHECK-NEXT: %or = or i1 true, %becond |
| 397 | ; CHECK-NEXT: --> %or U: [-1,0) S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 398 | ; CHECK-NEXT: Determining loop execution counts for: @reversed_or2 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 399 | ; CHECK-NEXT: Loop %loop: backedge-taken count is false |
| 400 | ; CHECK-NEXT: Loop %loop: max backedge-taken count is false |
| 401 | ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is false |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 402 | ; CHECK-NEXT: Predicates: |
| 403 | ; CHECK: Loop %loop: Trip multiple is 1 |
| 404 | ; |
| 405 | entry: |
| 406 | br label %loop |
| 407 | |
| 408 | loop: |
| 409 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 410 | %iv.inc = add nsw i32 %iv, 1 |
| 411 | %becond = icmp ugt i32 %iv.inc, %n |
| 412 | %or = or i1 true, %becond |
| 413 | br i1 %or, label %leave, label %loop |
| 414 | |
| 415 | leave: |
| 416 | ret void |
| 417 | } |
| 418 | |
| 419 | define void @reversed_or3(i32 %n) { |
| 420 | ; CHECK-LABEL: 'reversed_or3' |
| 421 | ; CHECK-NEXT: Classifying expressions for: @reversed_or3 |
| 422 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 423 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: %n LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 424 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 425 | ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: (1 + %n) LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 426 | ; CHECK-NEXT: %or = or i1 false, %becond |
| 427 | ; CHECK-NEXT: --> %or U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 428 | ; CHECK-NEXT: Determining loop execution counts for: @reversed_or3 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 429 | ; CHECK-NEXT: Loop %loop: backedge-taken count is %n |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 430 | ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 431 | ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n |
| 432 | ; CHECK-NEXT: Predicates: |
| 433 | ; CHECK: Loop %loop: Trip multiple is 1 |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 434 | ; |
| 435 | entry: |
| 436 | br label %loop |
| 437 | |
| 438 | loop: |
| 439 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 440 | %iv.inc = add nsw i32 %iv, 1 |
| 441 | %becond = icmp ugt i32 %iv.inc, %n |
| 442 | %or = or i1 false, %becond |
| 443 | br i1 %or, label %leave, label %loop |
| 444 | |
| 445 | leave: |
| 446 | ret void |
| 447 | } |
| 448 | |
| 449 | define void @reversed_or4(i32 %n) { |
| 450 | ; CHECK-LABEL: 'reversed_or4' |
| 451 | ; CHECK-NEXT: Classifying expressions for: @reversed_or4 |
| 452 | ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 453 | ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: %n LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 454 | ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 455 | ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: (1 + %n) LoopDispositions: { %loop: Computable } |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 456 | ; CHECK-NEXT: %or = or i1 %becond, false |
| 457 | ; CHECK-NEXT: --> %becond U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } |
| 458 | ; CHECK-NEXT: Determining loop execution counts for: @reversed_or4 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 459 | ; CHECK-NEXT: Loop %loop: backedge-taken count is %n |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 460 | ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1 |
Philip Reames | f1a9a83 | 2019-11-21 09:52:38 -0800 | [diff] [blame^] | 461 | ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n |
| 462 | ; CHECK-NEXT: Predicates: |
| 463 | ; CHECK: Loop %loop: Trip multiple is 1 |
Philip Reames | 3a8104a | 2019-11-19 11:48:51 -0800 | [diff] [blame] | 464 | ; |
| 465 | entry: |
| 466 | br label %loop |
| 467 | |
| 468 | loop: |
| 469 | %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] |
| 470 | %iv.inc = add nsw i32 %iv, 1 |
| 471 | %becond = icmp ugt i32 %iv.inc, %n |
| 472 | %or = or i1 %becond, false |
| 473 | br i1 %or, label %leave, label %loop |
| 474 | |
| 475 | leave: |
| 476 | ret void |
| 477 | } |