<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 17, 2009, at 12:10 PM, Jakob Stoklund Olesen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On Nov 17, 2009, at 11:47 AM, Evan Cheng wrote:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">On Nov 17, 2009, at 11:39 AM, Jakob Stoklund Olesen wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">On Nov 17, 2009, at 11:28 AM, Evan Cheng wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Hi Jakob,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I don't think this is the right way to do it. Checking RegisterRegAlloc::getDefault() seems pretty horrible.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Yes, it is pretty horrible.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">If I understand correctly, PHI elim should not require LiveVariables. It does this:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">LiveVariables *LV = getAnalysisIfAvailable<LiveVariables>();<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Will that work if LiveVariables is scheduled to run after PHIElimination? Can we control their order?<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">No. LiveVariables is an analysis pass. Later passes may require it. But that's ok, right? If it's run later, LV should do the right thing. But key point is if whatever is requiring phi elimination does not require LV, phi elimination should not bother with anything that needs LV info.<br></blockquote><br>Sure, but -split-phi-edges is supposed to be an optimization, so it would be nice to know is it is enabled or not.<br><br>If I don't require LiveVariables, it is run immediately before PHIElimination. I don't know why. Is it a coincidence?<br></div></blockquote><div><br></div>I am not sure. Please talk to Devang about this.</div><div><br><blockquote type="cite"><div><br>If the pass manager decides to run LiveVariables after PHIElimination, the -split-phi-edges optimization is silently disabled.<br></div></blockquote><div><br></div>That's ok for now. We only want to do it when the opportunity presents itself. That happens to be all the cases we care about now. That's a lot better than running livevariables with -regalloc=local.</div><div><br></div><div><br><blockquote type="cite"><div><br><br><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">So if LV is not available, i.e. not required by the register allocator, it should not perform splitting. That should work, right?<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">It is certainly possible to do it that way. I suppose that calling AU.setPreservesCFG() is less important?<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I am not sure. Please take a look at -debug-pass=Executions. Does phi elim splitting causes more passes to be run?<br></blockquote><br>It causes 'Machine Natural Loop Construction' to be run again.<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>Should it be preserving MachineLoopInfo?</div><div><br></div><div>Evan</div><div><br></div><div><br></div></body></html>