1; RUN: opt -passes='print<access-info>' -aa-pipeline='basic-aa' -disable-output < %s 2>&1 | FileCheck %s 2 3; For this loop: 4; for (int i = 0; i < n; i++) 5; A[2 * i] = A[2 * i] + B[i]; 6; 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 9; analysis. 10 11target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" 12 13; CHECK: Memory dependences are safe{{$}} 14 15define void @f(ptr noalias %a, 16 ptr noalias %b, i64 %N) { 17entry: 18 br label %for.body 19 20for.body: ; preds = %for.body, %entry 21 %ind = phi i64 [ 0, %entry ], [ %inc, %for.body ] 22 23 %mul = mul nuw nsw i64 %ind, 2 24 25 %arrayidxA = getelementptr inbounds i16, ptr %a, i64 %mul 26 %loadA = load i16, ptr %arrayidxA, align 2 27 28 %arrayidxB = getelementptr inbounds i16, ptr %b, i64 %ind 29 %loadB = load i16, ptr %arrayidxB, align 2 30 31 %add = mul i16 %loadA, %loadB 32 33 store i16 %add, ptr %arrayidxA, align 2 34 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 38 39for.end: ; preds = %for.body 40 ret void 41} 42