[llvm-dev] LLVM's loop unroller & llvm.loop.parallel_accesses

Hendrik Greving via llvm-dev llvm-dev at lists.llvm.org
Thu May 14 13:11:04 PDT 2020


Hi, in our backend, which is unfortunately not upstreamed, we are relying
on llvm.loop.parallel_accesses metadata for certain passes like software
pipelining so we can re-order instructions. Ideally, we would want the loop
unroller to support the notion of the loop's parallelism in its
pre-unrolled version. This probably should happen by propagating
!alias.scope and !alias metadata. Is there any plan or open patch for
supporting this?

Simplified example:

for.body:
%0 = load [..]
 store %0 [..]
br label %for.cond, !llvm.loop !2

!1 = distinct !{}
!2 = distinct !{!2, !3, !4, !5, !6, !7}
!3 = !{!"llvm.loop.parallel_accesses", !1}
!4 = !{!"llvm.loop.vectorize.width", i32 1}
!5 = !{!"llvm.loop.interleave.count", i32 1}
!6 = !{!"llvm.loop.vectorize.enable", i1 true}
!7 = !{!"llvm.loop.vectorize.followup_all", !8}
!8 = !{!"llvm.loop.unroll.count", i32 2}

(unroll by 2) =>

for.body:
%0 = load [..] !alias.scope !9 !noalias !11
store %0 [..] !alias.scope !9 !noalias !11
%1 = load [..] !alias.scope !10 !noalias !12
 store %1 [..] !alias.scope !10 !noalias !12
br label %for.cond, !llvm.loop !2

[..]

!9 = distinct !{!9, !"iteration0"}
!10 = distinct !{!10, !"iteration1"}
!11 = !{!10}
!12 = !{!9}

Thanks, Hendrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200514/a9bb64ca/attachment.html>


More information about the llvm-dev mailing list