1*7f498a86SDavid Sherwood; 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*7f498a86SDavid Sherwood; REQUIRES: asserts
3*7f498a86SDavid Sherwood; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize -S < %s 2>&1 | FileCheck %s
4*7f498a86SDavid Sherwoodtarget triple = "x86_64-unknown-linux-gnu"
5*7f498a86SDavid Sherwood
6*7f498a86SDavid Sherwooddefine ptr @foo(ptr %__first, ptr %__last) #0 {
7*7f498a86SDavid Sherwood; CHECK-LABEL: 'foo'
8*7f498a86SDavid Sherwood; CHECK:  LV: Found an estimated cost of 1 for VF 1 For instruction: store ptr %0, ptr %__last, align 8
9*7f498a86SDavid Sherwood; CHECK:  LV: Found an estimated cost of 2 for VF 2 For instruction: store ptr %0, ptr %__last, align 8
10*7f498a86SDavid Sherwood; CHECK:  LV: Found an estimated cost of 3 for VF 4 For instruction: store ptr %0, ptr %__last, align 8
11*7f498a86SDavid Sherwood; CHECK:  LV: Found an estimated cost of 3 for VF 8 For instruction: store ptr %0, ptr %__last, align 8
12*7f498a86SDavid Sherwood;
13*7f498a86SDavid Sherwoodentry:
14*7f498a86SDavid Sherwood  %cmp.not1 = icmp eq ptr %__first, %__last
15*7f498a86SDavid Sherwood  br i1 %cmp.not1, label %for.end, label %for.body.preheader
16*7f498a86SDavid Sherwood
17*7f498a86SDavid Sherwoodfor.body.preheader:
18*7f498a86SDavid Sherwood  br label %for.body
19*7f498a86SDavid Sherwood
20*7f498a86SDavid Sherwoodfor.body:
21*7f498a86SDavid Sherwood  %__first.addr.02 = phi ptr [ %incdec.ptr, %for.body ], [ %__first, %for.body.preheader ]
22*7f498a86SDavid Sherwood  %0 = load ptr, ptr %__first.addr.02, align 8
23*7f498a86SDavid Sherwood  store ptr %0, ptr %__last, align 8
24*7f498a86SDavid Sherwood  %incdec.ptr = getelementptr inbounds i8, ptr %__first.addr.02, i64 16
25*7f498a86SDavid Sherwood  %cmp.not = icmp eq ptr %incdec.ptr, %__last
26*7f498a86SDavid Sherwood  br i1 %cmp.not, label %for.end.loopexit, label %for.body
27*7f498a86SDavid Sherwood
28*7f498a86SDavid Sherwoodfor.end.loopexit:
29*7f498a86SDavid Sherwood  br label %for.end
30*7f498a86SDavid Sherwood
31*7f498a86SDavid Sherwoodfor.end:
32*7f498a86SDavid Sherwood  ret ptr null
33*7f498a86SDavid Sherwood}
34*7f498a86SDavid Sherwood
35*7f498a86SDavid Sherwoodattributes #0 = { "target-cpu"="znver4" }
36