38 lines · plain
1; RUN: opt -passes='print<access-info>' -disable-output < %s 2>&1 | FileCheck %s2 3; Analyze this loop:4; for (i = 0; i < n; i++)5; A[i + 4] = A[i] * 2;6 7; CHECK: Memory dependences are safe with a maximum safe vector width of 64 bits, with a maximum safe store-load forward width of 64 bits8 9target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"10target triple = "x86_64-apple-macosx10.10.0"11 12@A = common global ptr null, align 813 14define void @f() {15entry:16 %a = load ptr, ptr @A, align 817 br label %for.body18 19for.body: ; preds = %for.body, %entry20 %ind = phi i64 [ 0, %entry ], [ %add, %for.body ]21 22 %arrayidxA = getelementptr inbounds i16, ptr %a, i64 %ind23 %loadA = load i16, ptr %arrayidxA, align 224 25 %mul = mul i16 %loadA, 226 27 %next = add nuw nsw i64 %ind, 428 %arrayidxA_next = getelementptr inbounds i16, ptr %a, i64 %next29 store i16 %mul, ptr %arrayidxA_next, align 230 31 %add = add nuw nsw i64 %ind, 132 %exitcond = icmp eq i64 %add, 2033 br i1 %exitcond, label %for.end, label %for.body34 35for.end: ; preds = %for.body36 ret void37}38