1 ; RUN: opt -passes='print<access-info>' -disable-output < %s 2>&1 | FileCheck %s
4 ; for (i = 0; i < n; i++)
5 ; A[i + 1] = A[i] * B[i] * C[i];
7 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
10 ; CHECK: Has convergent operation in loop
11 ; CHECK: Report: cannot add control dependency to convergent operation
12 ; CHECK-NEXT: Dependences:
13 ; CHECK-NEXT: Backward:
14 ; CHECK-NEXT: %loadA = load i16, ptr %arrayidxA, align 2 ->
15 ; CHECK-NEXT: store i16 %mul1, ptr %arrayidxA_plus_2, align 2
16 ; CHECK: Run-time memory checks:
18 ; CHECK-NEXT: Comparing group
19 ; CHECK-NEXT: %arrayidxA = getelementptr inbounds i16, ptr %a, i64 %storemerge3
20 ; CHECK-NEXT: %arrayidxA_plus_2 = getelementptr inbounds i16, ptr %a, i64 %add
21 ; CHECK-NEXT: Against group
22 ; CHECK-NEXT: %arrayidxB = getelementptr inbounds i16, ptr %b, i64 %storemerge3
24 ; CHECK-NEXT: Comparing group
25 ; CHECK-NEXT: %arrayidxA = getelementptr inbounds i16, ptr %a, i64 %storemerge3
26 ; CHECK-NEXT: %arrayidxA_plus_2 = getelementptr inbounds i16, ptr %a, i64 %add
27 ; CHECK-NEXT: Against group
28 ; CHECK-NEXT: %arrayidxC = getelementptr inbounds i16, ptr %c, i64 %storemerge3
30 @B = common global ptr null, align 8
31 @A = common global ptr null, align 8
32 @C = common global ptr null, align 8
36 %a = load ptr, ptr @A, align 8
37 %b = load ptr, ptr @B, align 8
38 %c = load ptr, ptr @C, align 8
41 for.body: ; preds = %for.body, %entry
42 %storemerge3 = phi i64 [ 0, %entry ], [ %add, %for.body ]
44 %arrayidxA = getelementptr inbounds i16, ptr %a, i64 %storemerge3
45 %loadA = load i16, ptr %arrayidxA, align 2
47 %arrayidxB = getelementptr inbounds i16, ptr %b, i64 %storemerge3
48 %loadB = load i16, ptr %arrayidxB, align 2
50 %arrayidxC = getelementptr inbounds i16, ptr %c, i64 %storemerge3
51 %loadC = load i16, ptr %arrayidxC, align 2
53 call void @llvm.convergent()
55 %mul = mul i16 %loadB, %loadA
56 %mul1 = mul i16 %mul, %loadC
58 %add = add nuw nsw i64 %storemerge3, 1
59 %arrayidxA_plus_2 = getelementptr inbounds i16, ptr %a, i64 %add
60 store i16 %mul1, ptr %arrayidxA_plus_2, align 2
62 %exitcond = icmp eq i64 %add, 20
63 br i1 %exitcond, label %for.end, label %for.body
65 for.end: ; preds = %for.body
69 declare void @llvm.convergent() #0
71 attributes #0 = { nounwind readnone convergent }
72 attributes #1 = { nounwind convergent }