1 ; RUN: opt -passes='print<access-info>' -disable-output < %s 2>&1 | FileCheck %s
3 ; Handle memchecks involving loop-invariant addresses:
6 ; for (i = 0; i < N; ++i) {
10 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
12 ; CHECK: Memory dependences are safe with run-time checks
13 ; CHECK: Run-time memory checks:
14 ; CHECK-NEXT: Check 0:
15 ; CHECK-NEXT: Comparing group ({{.*}}):
16 ; CHECK-NEXT: %arrayidxA = getelementptr inbounds i32, ptr %a, i64 %ind
17 ; CHECK-NEXT: Against group ({{.*}}):
20 define void @f(ptr %a, ptr %b) {
24 for.body: ; preds = %for.body, %entry
25 %ind = phi i64 [ 0, %entry ], [ %inc, %for.body ]
27 %arrayidxA = getelementptr inbounds i32, ptr %a, i64 %ind
29 %loadB = load i32, ptr %b, align 4
30 store i32 %loadB, ptr %arrayidxA, align 4
32 %inc = add nuw nsw i64 %ind, 1
33 %exitcond = icmp eq i64 %inc, 20
34 br i1 %exitcond, label %for.end, label %for.body
36 for.end: ; preds = %for.body