<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 19, 2017 at 1:12 PM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><br><div><blockquote type="cite"><div>On Jan 19, 2017, at 12:04 PM, Daniel Berlin <<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>> wrote:</div><br class="m_2511294743644490236Apple-interchange-newline"><div><br class="m_2511294743644490236Apple-interchange-newline"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">On Thu, Jan 19, 2017 at 11:46 AM, Mehdi Amini via llvm-dev<span class="m_2511294743644490236Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.<wbr>org</a>></span><span class="m_2511294743644490236Apple-converted-space"> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><br>> On Jan 19, 2017, at 11:36 AM, Adve, Vikram Sadanand via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>><br>> Hi Johannes,<br>><br>>> I am especially curious where you get your data from. Tapir [0] (and to<br>>> some degree PIR [1]) have shown that, counterintuitively, only a few changes<br>>> to LLVM passes are needed. Tapir was recently used in an MIT class with a<br>>> lot of students and it seemed to work well with only minimal changes<br>>> to analysis and especially transformation passes.<br>><br>> TAPIR is an elegant, small extension and, in particular, I think the idea of asymmetric parallel tasks and control flow is a clever way to express parallelism with serial semantics, as in Cilk.  Encoding the control flow extensions as explicit instructions is orthogonal to that, though arguably more elegant than using region tags + metadata.<br>><br>> However, Cilk is a tiny language compared with the full complexity of other languages, like OpenMP.  To take just one example, TAPIR cannot express the ORDERED construct of OpenMP.  A more serious concern, IMO, is that TAPIR (like Cilk) requires serial semantics, whereas there are many parallel languages, OpenMP included, that do not obey that restriction.  Third, OpenMP has *numerous* clauses, e.g., REDUCTION or PRIVATE,  that are needed because without that, you’d be dependent on fundamentally hard compiler analyses to extract the same information for satisfactory parallel performance; realistic applications cannot depend on the success of such analyses.<br><br></span>I agree with this, but I’m also wondering if it needs to be first class in the IR?<br>For example we know our alias analysis is very basic, and C/C++ have a higher constraint thanks to their type system, but we didn’t inject this higher level information that helps the optimizer as first class IR constructs.<br></blockquote><div><br></div><div>FWIW, while i agree with the general point, i wouldn't use this example.</div><div>Because we pretty much still suffer to this day because of it (both in AA, and devirt, and ...)  :)</div><div>We can't always even tell fields apart</div></div></div></blockquote><br></div></div></div><div>Is it inherent to the infrastructure, i.e. using metadata instead of first class IR construct or is it just a “quality of implementation” issue?</div><div><br></div></div></blockquote><div><br></div><div>Not to derail this conversation:<br><br></div><div>IMHO, At some point there is no real difference :)</div><div><br></div><div>Because otherwise, everything is a QOI issue.</div><div><br></div><div>IE if it's super tricky to get metadata that works well and works right, doesn't get lost, etc, and that's inherent to using metadata, that to me is not a QOI issue.</div><div><br></div><div>So could it be done with metadata? Probably?</div><div>But at the same time,  if it had been done with more first class constructs, it would have happened years ago  and been much lower cost.</div><div><br></div><div>So it's all tradeoffs.</div><div><br></div><div><br></div><div><br></div></div></div></div>