[llvm-commits] [llvm] r46218 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp

Owen Anderson resistor at mac.com
Thu Jan 24 18:20:20 PST 2008


The basic check is: if one parameter to a PHI is defined in a block  
that dominates the block that another parameter is defined in, and it  
is live-out of that dominated block, then the two must be  
simultaneously live, so they can't be coallesced.  The difference  
between our implementation and the paper's description is in the  
choice of which one to insert copies for.

--Owen

On Jan 24, 2008, at 8:13 PM, Evan Cheng wrote:

> Hi Owen,
>
> I am not sure I completely understand the comment. Are you saying when
> a VReg is found to be live out of its definition block. This decides
> whether to place the copy in the definition block or in the use block?
>
> Evan
>
> On Jan 21, 2008, at 2:03 PM, Owen Anderson wrote:
>
>> Author: resistor
>> Date: Mon Jan 21 16:03:00 2008
>> New Revision: 46218
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=46218&view=rev
>> Log:
>> Clarify a deviation from the original algorithm.
>>
>> Modified:
>>   llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
>>
>> Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=46218&r1=46217&r2=46218&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> = 
>> =====================================================================
>> --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Mon Jan 21
>> 16:03:00 2008
>> @@ -552,7 +552,10 @@
>>      DomForestNode* child = *CI;
>>
>>      // If the current node is live-out of the defining block of
>> one of its
>> -      // children, insert a copy for it
>> +      // children, insert a copy for it.  NOTE: The paper actually
>> calls for
>> +      // a more elaborate heuristic for determining whether to
>> insert copies
>> +      // for the child or the parent.  In the interest of
>> simplicity, we're
>> +      // just always choosing the parent.
>>      if (isLiveOut(DFNode->getReg(),
>>          MRI.getVRegDef(child->getReg())->getParent(), MRI, LV)) {
>>        // Insert copies for parent
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list