|
| 1 | +; RUN: opt %s -S -loop-unroll -licm | FileCheck %s |
| 2 | + |
| 3 | +; Check that we can deal with loops where a parent loop gets deleted before it |
| 4 | +; is visited by LICM. |
| 5 | +define void @test() { |
| 6 | +; CHECK-LABEL: define void @test() { |
| 7 | +; CHECK-LABEL: entry: |
| 8 | +; CHECK-NEXT: br label %for.body43 |
| 9 | + |
| 10 | +; CHECK-LABEL: for.body43: ; preds = %entry |
| 11 | +; CHECK-NEXT: br label %if.else75 |
| 12 | + |
| 13 | +; CHECK-LABEL: if.else75: ; preds = %for.body43 |
| 14 | +; CHECK-NEXT: br label %for.body467 |
| 15 | + |
| 16 | +; CHECK-LABEL: for.body467: ; preds = %for.body467.for.body467_crit_edge, %if.else75 |
| 17 | +; CHECK-NEXT: br label %for.body467.for.body467_crit_edge |
| 18 | + |
| 19 | +; CHECK-LABEL: for.body467.for.body467_crit_edge: ; preds = %for.body467 |
| 20 | +; CHECK-NEXT: br i1 false, label %for.end539, label %for.body467 |
| 21 | + |
| 22 | +; CHECK-LABEL: for.end539: ; preds = %for.body467.for.body467_crit_edge |
| 23 | +; CHECK-NEXT: ret void |
| 24 | +; |
| 25 | + |
| 26 | +entry: |
| 27 | + br label %for.body43 |
| 28 | + |
| 29 | +for.body43: ; preds = %for.end539, %entry |
| 30 | + br label %if.else75 |
| 31 | + |
| 32 | +if.else75: ; preds = %for.body43 |
| 33 | + br label %for.body467 |
| 34 | + |
| 35 | +for.body467: ; preds = %for.body467.for.body467_crit_edge, %if.else75 |
| 36 | + br label %for.body467.for.body467_crit_edge |
| 37 | + |
| 38 | +for.body467.for.body467_crit_edge: ; preds = %for.body467 |
| 39 | + br i1 false, label %for.end539, label %for.body467 |
| 40 | + |
| 41 | +for.end539: ; preds = %for.body467 |
| 42 | + br i1 undef, label %for.body43, label %for.end547 |
| 43 | + |
| 44 | +for.end547: ; preds = %for.body43 |
| 45 | + ret void |
| 46 | +} |
0 commit comments