Peter Collingbourne | c85f4ce | 2015-11-20 01:26:13 +0000 | [diff] [blame] | 1 | ; RUN: opt -indvars -S %s | FileCheck %s |
| 2 | |
| 3 | %struct.A = type { i8 } |
| 4 | |
| 5 | @c = global %struct.A* null |
| 6 | @d = global i32 4 |
| 7 | |
| 8 | define void @_Z3fn1v() { |
| 9 | %x2 = load i32, i32* @d |
| 10 | %x3 = icmp slt i32 %x2, 1 |
| 11 | %x4 = select i1 %x3, i32 1, i32 %x2 |
| 12 | %x5 = load %struct.A*, %struct.A** @c |
| 13 | %j.sroa.0.0..sroa_idx = getelementptr %struct.A, %struct.A* %x5, i64 0, i32 0 |
| 14 | %j.sroa.0.0.copyload = load i8, i8* %j.sroa.0.0..sroa_idx |
| 15 | br label %.preheader4.lr.ph |
| 16 | |
| 17 | .preheader4.lr.ph: ; preds = %0 |
| 18 | ; CHECK-NOT: add i64 {{.*}}, 4294967296 |
| 19 | br label %.preheader4 |
| 20 | |
| 21 | .preheader4: ; preds = %x22, %.preheader4.lr.ph |
| 22 | %k.09 = phi i8* [ undef, %.preheader4.lr.ph ], [ %x25, %x22 ] |
| 23 | %x8 = icmp ult i32 0, 4 |
| 24 | br i1 %x8, label %.preheader.lr.ph, label %x22 |
| 25 | |
| 26 | .preheader.lr.ph: ; preds = %.preheader4 |
| 27 | br label %.preheader |
| 28 | |
| 29 | .preheader: ; preds = %x17, %.preheader.lr.ph |
| 30 | %k.17 = phi i8* [ %k.09, %.preheader.lr.ph ], [ %x19, %x17 ] |
| 31 | %v.06 = phi i32 [ 0, %.preheader.lr.ph ], [ %x20, %x17 ] |
| 32 | br label %x17 |
| 33 | |
| 34 | x17: ; preds = %.preheader |
| 35 | %x18 = sext i8 %j.sroa.0.0.copyload to i64 |
| 36 | %x19 = getelementptr i8, i8* %k.17, i64 %x18 |
| 37 | %x20 = add i32 %v.06, 1 |
| 38 | %x21 = icmp ult i32 %x20, %x4 |
| 39 | br i1 %x21, label %.preheader, label %._crit_edge.8 |
| 40 | |
| 41 | ._crit_edge.8: ; preds = %x17 |
| 42 | %split = phi i8* [ %x19, %x17 ] |
| 43 | br label %x22 |
| 44 | |
| 45 | x22: ; preds = %._crit_edge.8, %.preheader4 |
| 46 | %k.1.lcssa = phi i8* [ %split, %._crit_edge.8 ], [ %k.09, %.preheader4 ] |
| 47 | %x25 = getelementptr i8, i8* %k.1.lcssa |
| 48 | br label %.preheader4 |
| 49 | } |