|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "LV: Found an estimated cost of [0-9] for VF [0-9] For instruction:\s*store ptr %[0-9], ptr %__last" --filter "LV: Found an estimated cost of [0-9] for VF [0-9] For instruction:\s*store ptr %[0-9]" --version 5 |
| 2 | +; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize -S < %s 2>&1 | FileCheck %s --check-prefix=CHECK_IPTR |
| 3 | +target triple = "x86_64-unknown-linux-gnu" |
| 4 | + |
| 5 | +; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) |
| 6 | +define noalias ptr @foo(ptr readonly %__first, ptr writeonly %__last) #0 { |
| 7 | +; CHECK_IPTR-LABEL: 'foo' |
| 8 | +; CHECK_IPTR: LV: Found an estimated cost of 1 for VF 1 For instruction: store ptr %0, ptr %__last, align 8 |
| 9 | +; CHECK_IPTR: LV: Found an estimated cost of 2 for VF 2 For instruction: store ptr %0, ptr %__last, align 8 |
| 10 | +; CHECK_IPTR: LV: Found an estimated cost of 3 for VF 4 For instruction: store ptr %0, ptr %__last, align 8 |
| 11 | +; CHECK_IPTR: LV: Found an estimated cost of 3 for VF 8 For instruction: store ptr %0, ptr %__last, align 8 |
| 12 | +; |
| 13 | +entry: |
| 14 | + %cmp.not1 = icmp eq ptr %__first, %__last |
| 15 | + br i1 %cmp.not1, label %for.end, label %for.body.preheader |
| 16 | + |
| 17 | +for.body.preheader: ; preds = %entry |
| 18 | + br label %for.body |
| 19 | + |
| 20 | +for.body: ; preds = %for.body.preheader, %for.body |
| 21 | + %__first.addr.02 = phi ptr [ %incdec.ptr, %for.body ], [ %__first, %for.body.preheader ] |
| 22 | + %0 = load ptr, ptr %__first.addr.02, align 8 |
| 23 | + store ptr %0, ptr %__last, align 8 |
| 24 | + %incdec.ptr = getelementptr inbounds i8, ptr %__first.addr.02, i64 16 |
| 25 | + %cmp.not = icmp eq ptr %incdec.ptr, %__last |
| 26 | + br i1 %cmp.not, label %for.end.loopexit, label %for.body |
| 27 | + |
| 28 | +for.end.loopexit: ; preds = %for.body |
| 29 | + br label %for.end |
| 30 | + |
| 31 | +for.end: ; preds = %for.end.loopexit, %entry |
| 32 | + ret ptr null |
| 33 | +} |
| 34 | + |
| 35 | +attributes #0 = { "target-cpu"="znver4" } |
0 commit comments