1; REQUIRES: asserts
2
3; RUN: opt -loop-vectorize -debug-only=loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -vplan-print-in-dot-format -disable-output %s 2>&1 | FileCheck %s
4
5target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
6
7; Verify that -vplan-print-in-dot-format option works.
8
9define void @print_call_and_memory(i64 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
10; CHECK:       N0 [label =
11; CHECK-NEXT:    "for.body:\l" +
12; CHECK-NEXT:    "  WIDEN-INDUCTION %iv = phi %iv.next, 0\l" +
13; CHECK-NEXT:    "  CLONE ir\<%arrayidx\> = getelementptr ir\<%y\>, ir\<%iv\>\l" +
14; CHECK-NEXT:    "  WIDEN ir\<%lv\> = load ir\<%arrayidx\>\l" +
15; CHECK-NEXT:    "  WIDEN-CALL ir\<%call\> = call @llvm.sqrt.f32(ir\<%lv\>)\l" +
16; CHECK-NEXT:    "  CLONE ir\<%arrayidx2\> = getelementptr ir\<%x\>, ir\<%iv\>\l" +
17; CHECK-NEXT:    "  WIDEN store ir\<%arrayidx2\>, ir\<%call\>\l" +
18; CHECK-NEXT:    "No successors\l"
19; CHECK-NEXT:  ]
20;
21entry:
22  %cmp6 = icmp sgt i64 %n, 0
23  br i1 %cmp6, label %for.body, label %for.end
24
25for.body:                                         ; preds = %entry, %for.body
26  %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ]
27  %arrayidx = getelementptr inbounds float, float* %y, i64 %iv
28  %lv = load float, float* %arrayidx, align 4
29  %call = tail call float @llvm.sqrt.f32(float %lv) nounwind readnone
30  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %iv
31  store float %call, float* %arrayidx2, align 4
32  %iv.next = add i64 %iv, 1
33  %exitcond = icmp eq i64 %iv.next, %n
34  br i1 %exitcond, label %for.end, label %for.body
35
36for.end:                                          ; preds = %for.body, %entry
37  ret void
38}
39
40declare float @llvm.sqrt.f32(float) nounwind readnone
41