brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 4f4ba30 Raw
48 lines · plain
1; RUN: opt -passes='print<access-info>' -disable-output  < %s 2>&1 | FileCheck %s2 3; In:4;5;   store_ptr = A;6;   load_ptr = &A[2];7;   for (i = 0; i < n; i++)8;    *store_ptr++ = *load_ptr++ *10;  // A[i] = Aptr 109;10; make sure, we look through the PHI to conclude that store_ptr and load_ptr11; both have A as their underlying object.  The dependence is safe for12; vectorization requiring no memchecks.13;14; Otherwise we would try to prove independence with a memcheck that is going15; to always fail.16 17target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"18target triple = "x86_64-apple-macosx10.10.0"19 20; CHECK: Memory dependences are safe{{$}}21 22define void @f(ptr noalias %A, i64 %width) {23for.body.preheader:24  %A_ahead = getelementptr inbounds i8, ptr %A, i64 225  br label %for.body26 27for.body:28  %i = phi i64 [ %i.1, %for.body ], [ 0, %for.body.preheader ]29  %load_ptr = phi ptr [ %load_ptr.1, %for.body ], [ %A_ahead, %for.body.preheader ]30  %store_ptr = phi ptr [ %store_ptr.1, %for.body ], [ %A, %for.body.preheader ]31 32  %loadA = load i8, ptr %load_ptr, align 133 34  %mul = mul i8 %loadA, 1035 36  store i8 %mul, ptr %store_ptr, align 137 38  %load_ptr.1 = getelementptr inbounds i8, ptr %load_ptr, i64 139  %store_ptr.1 = getelementptr inbounds i8, ptr %store_ptr, i64 140  %i.1 = add nuw i64 %i, 141 42  %exitcond = icmp eq i64 %i.1, %width43  br i1 %exitcond, label %for.end, label %for.body44 45for.end:46  ret void47}48