[LLVMdev] undefs in phis

David Greene dag at cray.com
Fri Jan 30 13:52:23 PST 2009


On Friday 30 January 2009 15:10, David Greene wrote:

> This still looks correct.  The coalescer then says:
>
> 4360	%reg1177<def> = FsMOVAPSrr %reg1176<kill>	 ; srcLine 0
> 		Inspecting %reg1176,0 = [2702,4362:0)  0 at 2702-(4362) and %reg1177,0 =
> [2700,3712:0)[3768,3878:0)[4362,4372:0)  0 at 4362-(3878):
> 		Joined.  Result = %reg1177,0 = [2700,4372:0)  0 at 2702-(4362)
>
> Eh?  How can it coalesce these two?  Doesn't %reg1176:[2702,4362:0) overlap
> %reg1177:[2700,3712:0)?
>
> I will look into this further.  Just wanted to check in and make sure.

Ok, the Coalescer thinks %reg1177 value number 0 is defined by a copy from
%reg1176.  I guess that could be considered correct because %reg1177 is
defined by a copy from %reg1176 in bb108.  It thus considers the intervals to 
not interfere.

But this can't be right.  I think the problem is that there should be two 
value numbers for %reg1177.  We already have VN 0 defined from %reg1176.
What coalescing is missing is that %reg1177 is ALSO defined by an implicit def
from bb134.  That's the value number we're missing and is why coalescing
incorrectly removed the copy.

So it appears we can't get rid of the IMPLICIT DEF.  Evan, do you agree?

                                            -Dave




More information about the llvm-dev mailing list