brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · b000569 Raw
46 lines · plain
1; RUN: opt -passes='print<access-info>' -store-to-load-forwarding-conflict-detection=false  -disable-output  < %s 2>&1 | FileCheck %s2 3; This test checks that we prove the strided accesses to be independent before4; concluding that there is a forward dependence.5 6; struct pair {7;   int x;8;   int y;9; };10;11; int independent_interleaved(struct pair *p, int z, int n) {12;   int s = 0;13;   for (int i = 0; i < n; i++) {14;     p[i].y = z;15;     s += p[i].x;16;   }17;   return s;18; }19 20; CHECK:     for.body:21; CHECK-NOT:     Forward:22; CHECK-NOT:         store i32 %z, ptr %p_i.y, align 8 ->23; CHECK-NOT:         %0 = load i32, ptr %p_i.x, align 824 25%pair = type { i32, i32 }26define i32 @independent_interleaved(ptr %p, i64 %n, i32 %z) {27entry:28  br label %for.body29 30for.body:31  %i = phi i64 [ %i.next, %for.body ], [ 0, %entry ]32  %s = phi i32 [ %1, %for.body ], [ 0, %entry ]33  %p_i.x = getelementptr inbounds %pair, ptr %p, i64 %i, i32 034  %p_i.y = getelementptr inbounds %pair, ptr %p, i64 %i, i32 135  store i32 %z, ptr %p_i.y, align 836  %0 = load i32, ptr %p_i.x, align 837  %1 = add nsw i32 %0, %s38  %i.next = add nuw nsw i64 %i, 139  %cond = icmp slt i64 %i.next, %n40  br i1 %cond, label %for.body, label %for.end41 42for.end:43  %2 = phi i32 [ %1, %for.body ]44  ret i32 %245}46