<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Feb 8, 2014 at 2:36 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>></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"><div class="">On Feb 7, 2014, at 12:05 PM, Andrew Trick <<a href="mailto:atrick@apple.com">atrick@apple.com</a>> wrote:<br>
>>> (Note, there are plenty of places where SSAUpdater makes sense, so this isn't really about doing away with it at all.)<br>
>><br>
>> It’s worth noting that LCSSA predates SSAUpdater. If I went back in time and knew what I knew now, I wouldn’t have gone with LCSSA.<br>
>><br>
>> My gripes are three fold: 1) SSAUpdater can handle anything that LCSSA simplifies, 2) that LCSSA is annoying to keep up to date, 3) LCSSA burns compile time optimistically rewriting loop values, which are then later collapsed away even if nothing cares about those values.<br>
>><br>
>> My personal preference would be to get rid of LCSSA completely, but I don’t know how to stage that.<br>
><br>
> Until recently I felt exactly the same way. I didn’t want LCSSA just as another mechanism for updating SSA.<br>
><br>
> I’m warming up to having it run during the early loop passes if it<br>
> - significantly simplifies the LICM logic<br></div></blockquote><div><br></div><div>I've committed this in r201148 in order to fix several PRs. We can of course back it out and go down a different path if that's the end decision, but it seems better to not have asserts in the interim. =]</div>
<div><br></div><div>You can see the simplification to 'sink' that falls out of this though. This is, IMO, not a-typical.</div><div> </div><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">
<div class="">
> - greatly speeds up SSAUpdater within loops (maybe little net compile-time increase on average?)<br>
> - compartmentalizes loop transforms and SSA update so we can debug loop opts one loop at a time<br>
><br>
> I still don’t particularly like that we force all LLVM clients to perform LCSSA when all they end up doing is rotating and simplifying loops (no LICM/unroll). So it is a tradeoff.</div></blockquote><div><br></div><div>
Again, LoopSimplify does not require LCSSA today. Nothing to do there. If we folded rotate into simplify (which we should probably do) then we would be done.</div><div> </div><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">
<div class=""> <br></div></blockquote><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"><div class="">
</div>I don't have a strong opinion here, just throwing out some thoughts. You've been working on the loop passes much more recently, so if you think it is worth holding on to (or worth using just for the early passes?) then go for it.<br>
</blockquote><div><br></div><div>It's worth noting that getting rid of LCSSA would be a non-trivial amount of work and would have to be done somewhat carefully to preserve invariants of other passes in the LPM. Not saying we can't do it, but there is a reason to keep piling onto LCSSA until there is a clear decision to rip it out, and only then to rip all of it out at once.</div>
<div><br></div><div><br></div><div>Anyways, I'm still somewhat preferring to keep it in place for the simplifications. The cost appears to be quite small now that we don't invalidate all AA. ;]</div></div></div></div>