<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'><br><hr id="zwchr"><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Daniel Berlin" <dberlin@dberlin.org><br><b>To: </b>"Hal Finkel" <hfinkel@anl.gov><br><b>Cc: </b>rsilvera@google.com, "Chandler Carruth" <chandlerc@gmail.com>, "David Majnemer" <david.majnemer@gmail.com>, "Nicolai Hähnle-Montoro" <nhaehnle@gmail.com>, "Chad Rosier" <mcrosier@codeaurora.org>, "llvm-commits" <llvm-commits@lists.llvm.org>, reviews+D9375+public+6271545f2d8b34dd@reviews.llvm.org<br><b>Sent: </b>Monday, August 15, 2016 10:03:58 PM<br><b>Subject: </b>Re: [PATCH] D9375: An llvm.noalias intrinsic<br><br><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: rgb(0, 0, 0);"><span class=""><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>The one without loop info, can be readnone.</div><div>The with loop info, we figure that out :)</div></div></div></div></blockquote></span>That sounds great, but I don't have any idea how that would work. </div></div></blockquote><div><br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">At the point in time when I insert the intrinsics, I'm either in the inliner or in the frontend, and I don't know anything about loops.</div></div></blockquote><div> <br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">Moreover, I might be inserting the intrinsics into places that won't obviously dominate, or be inside, loops until after inlining.<span style="font-family: arial,sans-serif; font-size: small; color: rgb(34, 34, 34);"> </span></div></div></blockquote><div> <br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: rgb(0, 0, 0);"> Even if I add loop information to the inliner (which we'll want to do anyway), having the inliner each for newly-dominating llvm.noalias intrinsics and fix them up with information about the newly-inserted loops seems asymptotically unfavorable.<br></div></div></blockquote><div><br></div><div>Note that if we do loop info in the inliner, and keep it up to date, you already have all the info you need to fix-them-up, and i guess i don't see what the issue is.</div><div><br>At worst, all you have to do is track what block these things appear in, and when loopinfo determines that block has a loop id, you promote them and give them that loop id...</div><div>When it determines a block no longer has a loop id, you demote them.</div><div id="DWT17350">It already has to do all the real work to keep the loops up to date anyway ...<br></div></div></div></div></blockquote>Just to be clear, what I'm going to care about is finding intrinsics that dominate a given loop, not those in the loop. So either I need each loop to have some list of dominating intrinsics (i.e. originally dominating, neglecting any hosting that might occur), or each intrinsic needs a list of the loops it originally dominates. It is maintaining this that I was afraid could get expensive. These lists could be filtered by loops only containing some pointer based on the intrinsic (we can probably use a direct use/def check here because omission would be conservatively correct). Is your opinion still the same?<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div><br></div><div>Alternatively, unless they actually get used during inlining (and i don't see where they are), promote them post-inlining from one intrinsic to the other as a pass, since now it will understand the CFG/etc. I don't see this as a significantly different transform than us requiring/using LCSSA for most loop passes (though you'd run it right after inlining to make sure nothing broke them). </div><div><br></div><div>Given past experience, i'm very very wary of us trying to have implicit control flow dependence like this, and to add yet another intrinsic we expect to generate often, but are marking as read-write, pessimizing plenty of stuff.</div><div id="DWT17351">Particularly when we know that, post-inlining, if none of them ended up in loops, we don't actually care where they go.<br></div></div></div></div></blockquote>Me too. This is why if we can come up with an alternate design, I'm quite happy :-)<br><br> -Hal<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div><br></div><div>I'm fine with having the scope be implicit temporarily because i understand you are just trying to transmit language level scope info, but at some point, we should be converting that language level scope info into something expressed only in terms of llvm's cfg/info/etc if we can.</div><div><br></div><div>(and FWIW: i would call this thing llvm.noalias.scope, like you suggested in one place)<br></div><div><br></div><div>--Dan</div><div><br></div></div></div></div>
</blockquote><br><br><br>-- <br><div><span name="x"></span>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></div></body></html>