1 ; RUN: opt -passes='print<access-info>' -aa-pipeline='basic-aa' -disable-output < %s 2>&1 | FileCheck %s
4 ; for (int i = 0; i < n; i++)
5 ; A[2 * i] = A[2 * i] + B[i];
7 ; , SCEV is unable to prove that A[2 * i] does not overflow. However,
8 ; analyzing the IR helps us to conclude it and in turn allow dependence
11 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
13 ; CHECK: Memory dependences are safe{{$}}
15 define void @f(ptr noalias %a,
16 ptr noalias %b, i64 %N) {
20 for.body: ; preds = %for.body, %entry
21 %ind = phi i64 [ 0, %entry ], [ %inc, %for.body ]
23 %mul = mul nuw nsw i64 %ind, 2
25 %arrayidxA = getelementptr inbounds i16, ptr %a, i64 %mul
26 %loadA = load i16, ptr %arrayidxA, align 2
28 %arrayidxB = getelementptr inbounds i16, ptr %b, i64 %ind
29 %loadB = load i16, ptr %arrayidxB, align 2
31 %add = mul i16 %loadA, %loadB
33 store i16 %add, ptr %arrayidxA, align 2
35 %inc = add nuw nsw i64 %ind, 1
36 %exitcond = icmp eq i64 %inc, %N
37 br i1 %exitcond, label %for.end, label %for.body
39 for.end: ; preds = %for.body