1 ; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
4 ;; Test to make sure the dump shows the src and dst
5 ;; instructions (including call instructions).
7 ;; void bar(ptr restrict A);
8 ;; void foo(ptr restrict A, int n) {
9 ;; for (int i = 0; i < n; i++) {
17 ; CHECK: Src: store float %conv, ptr %arrayidx, align 4 --> Dst: store float %conv, ptr %arrayidx, align 4
18 ; CHECK-NEXT: da analyze - none!
19 ; CHECK-NEXT: Src: store float %conv, ptr %arrayidx, align 4 --> Dst: call void @bar(ptr %A)
20 ; CHECK-NEXT: da analyze - confused!
21 ; CHECK-NEXT: Src: call void @bar(ptr %A) --> Dst: call void @bar(ptr %A)
22 ; CHECK-NEXT: da analyze - confused!
24 define void @foo(ptr noalias %A, i32 signext %n) {
26 %cmp1 = icmp slt i32 0, %n
27 br i1 %cmp1, label %for.body.lr.ph, label %for.end
29 for.body.lr.ph: ; preds = %entry
32 for.body: ; preds = %for.body.lr.ph, %for.body
33 %i.02 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
34 %conv = sitofp i32 %i.02 to float
35 %idxprom = zext i32 %i.02 to i64
36 %arrayidx = getelementptr inbounds float, ptr %A, i64 %idxprom
37 store float %conv, ptr %arrayidx, align 4
38 call void @bar(ptr %A) #3
39 %inc = add nuw nsw i32 %i.02, 1
40 %cmp = icmp slt i32 %inc, %n
41 br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge
43 for.cond.for.end_crit_edge: ; preds = %for.body
46 for.end: ; preds = %for.cond.for.end_crit_edge, %entry
50 declare void @bar(ptr)