|
| 1 | +; RUN: llc -march=hexagon -mv71 -O2 < %s -o - 2>&1 > /dev/null |
| 2 | +; Ensure we do not invalidate a DAG by forming a circuit. |
| 3 | +; If we form a circuit, this test crashes while creating the DAG |
| 4 | +; with topological sorting. |
| 5 | + |
| 6 | +%struct.quux = type { i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, [2 x i8], %struct.ham, %struct.bar, i8 } |
| 7 | +%struct.ham = type { i8, [2 x i8], [2 x i8], [2 x i8] } |
| 8 | +%struct.bar = type { [2 x i8], [2 x i8], [2 x i8] } |
| 9 | + |
| 10 | +define dso_local void @blam(i32 %arg) local_unnamed_addr #0 { |
| 11 | +bb: |
| 12 | + br label %bb1 |
| 13 | + |
| 14 | +bb1: ; preds = %bb1, %bb |
| 15 | + %phi = phi i8 [ %phi6, %bb1 ], [ undef, %bb ] |
| 16 | + %phi2 = phi i8 [ %phi, %bb1 ], [ undef, %bb ] |
| 17 | + %phi3 = phi i8 [ %phi2, %bb1 ], [ 0, %bb ] |
| 18 | + %phi4 = phi i8 [ %phi3, %bb1 ], [ undef, %bb ] |
| 19 | + %phi5 = phi i8 [ %phi4, %bb1 ], [ undef, %bb ] |
| 20 | + %phi6 = phi i8 [ %phi5, %bb1 ], [ undef, %bb ] |
| 21 | + %phi7 = phi i32 [ %add, %bb1 ], [ undef, %bb ] |
| 22 | + %getelementptr = getelementptr inbounds %struct.quux, ptr null, i32 %arg, i32 12, i32 1, i32 undef |
| 23 | + store i8 %phi4, ptr %getelementptr, align 1 |
| 24 | + %add = add i32 %phi7, -1 |
| 25 | + %icmp = icmp eq i32 %add, 0 |
| 26 | + br i1 %icmp, label %bb8, label %bb1 |
| 27 | + |
| 28 | +bb8: ; preds = %bb1 |
| 29 | + ret void |
| 30 | +} |
| 31 | + |
| 32 | +attributes #0 = { "target-features"="+v71,-long-calls,-small-data" } |
0 commit comments