• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
2; RUN: | FileCheck %s
3
4;; Test to make sure the dump shows the src and dst
5;; instructions (including call instructions).
6;;
7;; void bar(float * restrict A);
8;; void foo(float * restrict A, int n) {
9;;   for (int i = 0; i < n; i++) {
10;;     A[i] = i;
11;;     bar(A);
12;;   }
13;; }
14
15; CHECK-LABEL: foo
16
17; CHECK: Src:  store float %conv, float* %arrayidx, align 4 --> Dst:  store float %conv, float* %arrayidx, align 4
18; CHECK-NEXT:   da analyze - none!
19; CHECK-NEXT: Src:  store float %conv, float* %arrayidx, align 4 --> Dst:  call void @bar(float* %A)
20; CHECK-NEXT:   da analyze - confused!
21; CHECK-NEXT: Src:  call void @bar(float* %A) --> Dst:  call void @bar(float* %A)
22; CHECK-NEXT:   da analyze - confused!
23
24define void @foo(float* noalias %A, i32 signext %n) {
25entry:
26  %cmp1 = icmp slt i32 0, %n
27  br i1 %cmp1, label %for.body.lr.ph, label %for.end
28
29for.body.lr.ph:                                   ; preds = %entry
30  br label %for.body
31
32for.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, float* %A, i64 %idxprom
37  store float %conv, float* %arrayidx, align 4
38  call void @bar(float* %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
42
43for.cond.for.end_crit_edge:                       ; preds = %for.body
44  br label %for.end
45
46for.end:                                          ; preds = %for.cond.for.end_crit_edge, %entry
47  ret void
48}
49
50declare void @bar(float*)
51