<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, May 10, 2018 at 5:40 PM Sanjoy Das via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">sanjoy added a comment.<br>
<br>
Actually now that I think of it, I wonder if looking back through the condition expression tree to find all loop invariant values is necessary -- if we see these kinds of cases `(loop_varying & loop_invariant0) & loop_invariant1)` then perhaps we should teach LICM et. al. to reassociate and hoist the `loop_invariant0 & loop_invariant1` bit instead of worrying about them in loop unswitch?<br></blockquote><div><br></div><div>I think we should teach LICM to do this if it doesn't already, but it seems like this could also come up due to prior (trivial) unswitches? So it might still be important to handle them? </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D46706" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46706</a><br>
<br>
<br>
<br>
</blockquote></div></div>