<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 13, 2018 at 6:46 PM David A. Greene via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[...]<br><br>
The harder cases are where the analysis phase itself does some<br>
transformation (possily to facilitate analysis) and then decides the<br>
larger-goal transformation is not viable.  If the pass then tries to<br>
undo the first transformation, it's possible that -pass-max will result<br>
in code that never would have been generated, because it could do the<br>
first transformation but then not undo it because it hit the max number<br>
of transforms.  Sometimes it's difficult to find where things are undone<br>
and update the transformation index (basically allow the undo and<br>
decrement the index to reflect the undo).<br></blockquote><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">It should be pointed out that analyses don't transform the IR. At least not in the new PassManager, which I think we should focus on in this proposal.</span></div><div><br></div><div>Cheers,</div><div>Philip </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
In code:<br>
<br>
if (not hit max)<br>
  do anlysis transform<br>
  ++index<br>
<br>
return<br>
<br>
<some other function><br>
<br>
if (transform legal)<br>
  if (not hit max)<br>
    do big transform<br>
    ++index<br>
<br>
return<br>
<br>
<some third function><br>
if (need to undo analysis transform)<br>
  if (not hit max)<br>
    undo it<br>
    ++index<br>
<br>
Sometimes it is not obvious that these three places are logically<br>
connected.  Ideally we wouldn't increment the index for the analysis<br>
transform or we would allow the undo and decrement the index, but it's<br>
not always clear from the code that that is what should happen.<br>
<br>
                            -David<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>