[PATCH] D15706: [Polly] Follow uses to create value MemoryAccesses

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 17:29:25 PST 2015


> +; TODO: Because of the phi with 3 incoming blocks, the loop for => outofscop is 
> +; not recognized as a loop, but as a non-affine subregion.
My guess would be this is because ScalarEvolution cannot create an
AddRec for %j. PHIs with multiple incoming blocks are generally not a
problem.

> +
> +define void @func(i32 %n, double* nonnull noalias %A) {
> +entry:
> +  br label %for
> +
> +for:
> +  %phi = phi double [0.0, %entry], [0.0, %inc], [%phi, %outofscop]
> +  %j = phi i32 [0, %entry], [%j.inc, %inc], [0, %outofscop]
> +  %j.cmp = icmp slt i32 %j, %n
> +  br i1 %j.cmp, label %body, label %outofscop
> +
> +body:
> +  store double 4.2, double* %A
> +  br label %inc
> +
> +inc:
> +  %j.inc = add nuw nsw i32 %j, 1
> +  br label %for
> +
> +outofscop:
> +  fence seq_cst
> +  br i1 true, label %return, label %for
> +
> +return:
> +  ret void
> +}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151222/6e077974/attachment.sig>


More information about the llvm-commits mailing list