|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5 |
| 2 | +; RUN: opt < %s -disable-output "-passes=print<da>" 2>&1 | FileCheck %s |
| 3 | + |
| 4 | +define void @_Z1cb(ptr %a) { |
| 5 | +; CHECK-LABEL: '_Z1cb' |
| 6 | +; CHECK-NEXT: Src: store i8 0, ptr %arrayidx9, align 1 --> Dst: store i8 0, ptr %arrayidx9, align 1 |
| 7 | +; CHECK-NEXT: da analyze - output [*]! |
| 8 | +; |
| 9 | +entry: |
| 10 | + br label %for.body |
| 11 | + |
| 12 | +for.cond.cleanup.loopexit: ; preds = %for.body |
| 13 | + ret void |
| 14 | + |
| 15 | +for.body: ; preds = %for.body, %entry |
| 16 | + %indvars.iv23 = phi i64 [ 0, %entry ], [ %indvars.iv.next24, %for.body ] |
| 17 | + %idxprom = and i64 %indvars.iv23, 1 |
| 18 | + %arrayidx9 = getelementptr inbounds [0 x [12 x [12 x i8]]], ptr %a, i64 0, i64 %idxprom, i64 0, i64 %indvars.iv23 |
| 19 | + store i8 0, ptr %arrayidx9, align 1 |
| 20 | + %indvars.iv.next24 = add i64 %indvars.iv23, 1 |
| 21 | + %exitcond.not = icmp eq i64 %indvars.iv.next24, 0 |
| 22 | + br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body |
| 23 | +} |
| 24 | + |
| 25 | +@a = external global [0 x [12 x [12 x i8]]], align 1 |
| 26 | + |
| 27 | +define void @test_siv_no_addrec(i1 %d, i32 %b) { |
| 28 | +; CHECK-LABEL: 'test_siv_no_addrec' |
| 29 | +; CHECK-NEXT: Src: store i8 0, ptr %arrayidx7, align 1 --> Dst: store i8 0, ptr %arrayidx7, align 1 |
| 30 | +; CHECK-NEXT: da analyze - output [* *]! |
| 31 | +; |
| 32 | +entry: |
| 33 | + %conv.val = select i1 %d, i16 1, i16 0 |
| 34 | + br label %for.cond |
| 35 | + |
| 36 | +for.cond: ; preds = %for.inc8, %entry |
| 37 | + %e.0 = phi i32 [ %b, %entry ], [ %inc9, %for.inc8 ] |
| 38 | + %cmp = icmp ult i32 %e.0, 10 |
| 39 | + br i1 %cmp, label %for.cond1, label %for.end10 |
| 40 | + |
| 41 | +for.cond1: ; preds = %for.inc, %for.cond |
| 42 | + %f.0 = phi i16 [ %conv.val, %for.cond ], [ %add, %for.inc ] |
| 43 | + %cmp2 = icmp slt i16 %f.0, 10 |
| 44 | + br i1 %cmp2, label %for.body4, label %for.inc8 |
| 45 | + |
| 46 | +for.body4: ; preds = %for.cond1 |
| 47 | + %sub = add i32 %e.0, -3 |
| 48 | + %idxprom = zext i32 %sub to i64 |
| 49 | + %idxprom5 = sext i16 %f.0 to i64 |
| 50 | + %idxprom6 = zext i32 %e.0 to i64 |
| 51 | + %arrayidx7 = getelementptr inbounds [0 x [12 x [12 x i8]]], ptr @a, i64 0, i64 %idxprom, i64 %idxprom5, i64 %idxprom6 |
| 52 | + store i8 0, ptr %arrayidx7, align 1 |
| 53 | + br label %for.inc |
| 54 | + |
| 55 | +for.inc: ; preds = %for.body4 |
| 56 | + %add = add i16 %f.0, 2 |
| 57 | + br label %for.cond1 |
| 58 | + |
| 59 | +for.inc8: ; preds = %for.cond1 |
| 60 | + %inc9 = add i32 %e.0, 1 |
| 61 | + br label %for.cond |
| 62 | + |
| 63 | +for.end10: ; preds = %for.cond |
| 64 | + ret void |
| 65 | +} |
| 66 | + |
| 67 | +define void @f1(ptr %a) { |
| 68 | +; CHECK-LABEL: 'f1' |
| 69 | +; CHECK-NEXT: Src: store i8 0, ptr %idx, align 1 --> Dst: store i8 0, ptr %idx, align 1 |
| 70 | +; CHECK-NEXT: da analyze - output [*]! |
| 71 | +; |
| 72 | +entry: |
| 73 | + br label %loop |
| 74 | + |
| 75 | +loop: |
| 76 | + %i = phi i64 [ 0, %entry ], [ %i.next, %loop ] |
| 77 | + %and = and i64 %i, 1 |
| 78 | + %idx = getelementptr inbounds [4 x [4 x i8]], ptr %a, i64 0, i64 %and, i64 %and |
| 79 | + store i8 0, ptr %idx |
| 80 | + %i.next = add i64 %i, 1 |
| 81 | + %exitcond.not = icmp slt i64 %i.next, 8 |
| 82 | + br i1 %exitcond.not, label %loop, label %exit |
| 83 | + |
| 84 | +exit: |
| 85 | + ret void |
| 86 | +} |
0 commit comments