brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 8c69b2e Raw
39 lines · plain
1; RUN: opt -passes='print<access-info>' -disable-output  < %s 2>&1 | FileCheck %s2 3; Handle memchecks involving loop-invariant addresses:4;5; extern int *A, *b;6; for (i = 0; i < N; ++i) {7;  A[i] = b;8; }9 10target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"11 12; CHECK: Memory dependences are safe with run-time checks13; CHECK: Run-time memory checks:14; CHECK-NEXT: Check 0:15; CHECK-NEXT:   Comparing group16; CHECK-NEXT:     %arrayidxA = getelementptr inbounds i32, ptr %a, i64 %ind17; CHECK-NEXT:   Against group18; CHECK-NEXT:   ptr %b19 20define void @f(ptr %a, ptr %b) {21entry:22  br label %for.body23 24for.body:                                         ; preds = %for.body, %entry25  %ind = phi i64 [ 0, %entry ], [ %inc, %for.body ]26 27  %arrayidxA = getelementptr inbounds i32, ptr %a, i64 %ind28 29  %loadB = load i32, ptr %b, align 430  store i32 %loadB, ptr %arrayidxA, align 431 32  %inc = add nuw nsw i64 %ind, 133  %exitcond = icmp eq i64 %inc, 2034  br i1 %exitcond, label %for.end, label %for.body35 36for.end:                                          ; preds = %for.body37  ret void38}39