<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi, Hendrik,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
A couple of thoughts:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
 1. This might be related (but, perhaps, not in the way you'd prefer): <a href="https://bugs.llvm.org/show_bug.cgi?id=39282">https://bugs.llvm.org/show_bug.cgi?id=39282</a></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
 2. We're scheduling a call to discuss further improvements in this area, and if you might be able to join, please fill out the Doodle poll: <a href="https://doodle.com/poll/evhwr2eyfvcf8ib3" id="LPlnk470905">https://doodle.com/poll/evhwr2eyfvcf8ib3</a></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
 -Hal</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div>
<div id="Signature">
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hal Finkel<br>
Lead, Compiler Technology and Programming Languages<br>
Leadership Computing Facility<br>
Argonne National Laboratory</div>
</span></font></div>
</div>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> llvm-dev <llvm-dev-bounces@lists.llvm.org> on behalf of Hendrik Greving via llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Sent:</b> Thursday, May 14, 2020 3:11 PM<br>
<b>To:</b> llvm-dev@lists.llvm.org <llvm-dev@lists.llvm.org><br>
<b>Cc:</b> Marcello Maggioni <maggioni@google.com><br>
<b>Subject:</b> [llvm-dev] LLVM's loop unroller & llvm.loop.parallel_accesses</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>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?</div>
<div><br>
</div>
<div>Simplified example:</div>
<div><br>
</div>
<div>for.body:<br>
</div>
<div>%0 = load [..]<br>
</div>
<div> store %0 [..]</div>
<div>br label %for.cond, !llvm.loop !2<br>
</div>
<div><br>
</div>
<div>!1 = distinct !{}<br>
</div>
<div>!2 = distinct !{!2, !3, !4, !5, !6, !7}<br>
!3 = !{!"llvm.loop.parallel_accesses", !1}<br>
!4 = !{!"llvm.loop.vectorize.width", i32 1}<br>
!5 = !{!"llvm.loop.interleave.count", i32 1}<br>
!6 = !{!"llvm.loop.vectorize.enable", i1 true}<br>
</div>
<div>!7 = !{!"llvm.loop.vectorize.followup_all", !8}<br>
</div>
<div>!8 = !{!"llvm.loop.unroll.count", i32 2}<br>
</div>
<div><br>
</div>
<div>(unroll by 2) =></div>
<div><br>
</div>
<div>
<div>for.body:<br>
</div>
<div>%0 = load [..] !alias.scope !9 !noalias !11<br>
</div>
<div>store %0 [..] !alias.scope !9 !noalias !11</div>
<div>%1 = load [..] !alias.scope !10 !noalias !12<br>
</div>
<div> store %1 [..] !alias.scope !10 !noalias !12</div>
<div></div>
<div>br label %for.cond, !llvm.loop !2<br>
</div>
<div><br>
</div>
<div>[..]</div>
<div><br>
</div>
<div>!9 = distinct !{!9, !"iteration0"}<br>
</div>
<div>!10 = distinct !{!10, !"iteration1"}<br>
</div>
<div></div>
<div>!11 = !{!10}<br>
</div>
<div>!12 = !{!9}<br>
</div>
<div><br>
</div>
<div>Thanks, Hendrik</div>
</div>
</div>
</div>
</div>
</body>
</html>