[llvm-commits] [llvm] r89125 - in /llvm/trunk: lib/CodeGen/PHIElimination.cpp test/CodeGen/X86/2008-04-15-LiveVariableBug.ll test/CodeGen/X86/stack-color-with-reg.ll

Evan Cheng evan.cheng at apple.com
Tue Nov 17 12:23:12 PST 2009


On Nov 17, 2009, at 12:10 PM, Jakob Stoklund Olesen wrote:

> 
> On Nov 17, 2009, at 11:47 AM, Evan Cheng wrote:
> 
>> 
>> On Nov 17, 2009, at 11:39 AM, Jakob Stoklund Olesen wrote:
>> 
>>> 
>>> On Nov 17, 2009, at 11:28 AM, Evan Cheng wrote:
>>> 
>>>> Hi Jakob,
>>>> 
>>>> I don't think this is the right way to do it. Checking RegisterRegAlloc::getDefault() seems pretty horrible.
>>> 
>>> Yes, it is pretty horrible.
>>> 
>>>> If I understand correctly, PHI elim should not require LiveVariables. It does this:
>>>> LiveVariables *LV = getAnalysisIfAvailable<LiveVariables>();
>>> 
>>> Will that work if LiveVariables is scheduled to run after PHIElimination? Can we control their order?
>> 
>> 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.
> 
> Sure, but -split-phi-edges is supposed to be an optimization, so it would be nice to know is it is enabled or not.
> 
> If I don't require LiveVariables, it is run immediately before PHIElimination. I don't know why. Is it a coincidence?

I am not sure. Please talk to Devang about this.

> 
> If the pass manager decides to run LiveVariables after PHIElimination, the -split-phi-edges optimization is silently disabled.

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.


> 
> 
>>>> So if LV is not available, i.e. not required by the register allocator, it should not perform splitting. That should work, right?
>>> 
>>> It is certainly possible to do it that way. I suppose that calling AU.setPreservesCFG() is less important?
>> 
>> I am not sure. Please take a look at -debug-pass=Executions. Does phi elim splitting causes more passes to be run?
> 
> It causes 'Machine Natural Loop Construction' to be run again.

Should it be preserving MachineLoopInfo?

Evan


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20091117/0bbb4a83/attachment.html>


More information about the llvm-commits mailing list