|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5 |
| 2 | +; RUN: opt -disable-output -passes='print<access-info>' %s 2>&1 | FileCheck %s |
| 3 | + |
| 4 | +target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" |
| 5 | + |
| 6 | +define void @monotonic_ptr_simple(ptr writeonly %dst, ptr readonly %src, i32 %c, i32 %n) { |
| 7 | +; CHECK-LABEL: 'monotonic_ptr_simple' |
| 8 | +; CHECK-NEXT: for.body: |
| 9 | +; CHECK-NEXT: Report: cannot identify array bounds |
| 10 | +; CHECK-NEXT: Dependences: |
| 11 | +; CHECK-NEXT: Run-time memory checks: |
| 12 | +; CHECK-NEXT: Grouped accesses: |
| 13 | +; CHECK-EMPTY: |
| 14 | +; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop. |
| 15 | +; CHECK-NEXT: SCEV assumptions: |
| 16 | +; CHECK-EMPTY: |
| 17 | +; CHECK-NEXT: Expressions re-written: |
| 18 | +; |
| 19 | +entry: |
| 20 | + %wide.trip.count = zext nneg i32 %n to i64 |
| 21 | + br label %for.body |
| 22 | + |
| 23 | +for.body: |
| 24 | + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ] |
| 25 | + %dst.addr.09 = phi ptr [ %dst, %entry ], [ %dst.addr.1, %for.inc ] |
| 26 | + %arrayidx = getelementptr inbounds i32, ptr %src, i64 %indvars.iv |
| 27 | + %0 = load i32, ptr %arrayidx, align 4 |
| 28 | + %cmp1 = icmp slt i32 %0, %c |
| 29 | + br i1 %cmp1, label %if.then, label %for.inc |
| 30 | + |
| 31 | +if.then: |
| 32 | + %incdec.ptr = getelementptr inbounds i8, ptr %dst.addr.09, i64 4 |
| 33 | + store i32 %0, ptr %dst.addr.09, align 4 |
| 34 | + br label %for.inc |
| 35 | + |
| 36 | +for.inc: |
| 37 | + %dst.addr.1 = phi ptr [ %incdec.ptr, %if.then ], [ %dst.addr.09, %for.body ] |
| 38 | + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| 39 | + %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count |
| 40 | + br i1 %exitcond.not, label %exit, label %for.body |
| 41 | + |
| 42 | +exit: |
| 43 | + ret void |
| 44 | +} |
| 45 | + |
| 46 | +define void @monotonic_ptr_indexed(ptr writeonly %dst, ptr readonly %src, i32 %c, i32 %n) { |
| 47 | +; CHECK-LABEL: 'monotonic_ptr_indexed' |
| 48 | +; CHECK-NEXT: for.body: |
| 49 | +; CHECK-NEXT: Report: cannot identify array bounds |
| 50 | +; CHECK-NEXT: Dependences: |
| 51 | +; CHECK-NEXT: Run-time memory checks: |
| 52 | +; CHECK-NEXT: Grouped accesses: |
| 53 | +; CHECK-EMPTY: |
| 54 | +; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop. |
| 55 | +; CHECK-NEXT: SCEV assumptions: |
| 56 | +; CHECK-EMPTY: |
| 57 | +; CHECK-NEXT: Expressions re-written: |
| 58 | +; |
| 59 | +entry: |
| 60 | + %wide.trip.count = zext nneg i32 %n to i64 |
| 61 | + br label %for.body |
| 62 | + |
| 63 | +for.body: |
| 64 | + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ] |
| 65 | + %idx.012 = phi i32 [ 0, %entry ], [ %idx.1, %for.inc ] |
| 66 | + %arrayidx = getelementptr inbounds i32, ptr %src, i64 %indvars.iv |
| 67 | + %0 = load i32, ptr %arrayidx, align 4 |
| 68 | + %cmp1 = icmp slt i32 %0, %c |
| 69 | + br i1 %cmp1, label %if.then, label %for.inc |
| 70 | + |
| 71 | +if.then: |
| 72 | + %inc = add nsw i32 %idx.012, 1 |
| 73 | + %idxprom4 = sext i32 %idx.012 to i64 |
| 74 | + %arrayidx5 = getelementptr inbounds i32, ptr %dst, i64 %idxprom4 |
| 75 | + store i32 %0, ptr %arrayidx5, align 4 |
| 76 | + br label %for.inc |
| 77 | + |
| 78 | +for.inc: |
| 79 | + %idx.1 = phi i32 [ %inc, %if.then ], [ %idx.012, %for.body ] |
| 80 | + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| 81 | + %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count |
| 82 | + br i1 %exitcond.not, label %exit, label %for.body |
| 83 | + |
| 84 | +exit: |
| 85 | + ret void |
| 86 | +} |
0 commit comments