On 11/13/20 6:55 AM, Segher Boessenkool wrote:
> Hi guys,
>
> On Thu, Nov 12, 2020 at 09:10:14PM -0700, Jeff Law wrote:
>> On 11/12/20 7:02 PM, Xionghu Luo via Gcc wrote:
>>> The output shows "REQ_EQUAL r118:DI+0x66546b64" is deleted by 
>>> df_remove_dead_eq_notes,
>>> but r120:DI is not REG_DEAD here, so is it correct here to check insn use 
>>> and find that
>>> r118:DI is dead then do the delete?
>> It doesn't matter where the death occurs, any REG_DEAD note will cause
>> the REG_EQUAL note to be removed.  So given the death note for r118,
>> then any REG_EQUAL note that references r118 will be removed.  This is
>> overly pessimistic as the note may still be valid/useful at some
>> points.  See
>>
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92291
> The note even *always* is valid where it is!  As you say, the REG_EQUAL
> is only (necessarily) valid at *that* insn.  And this insn *sets* the
> reg (that is the only case when a REG_EQ* is allowed at all), so if the
> eq reg is dead (i.e. unused) the whole insn is, and the insn can be
> removed.
>
> Removing all REG_EQUAL notes for regs that become dead anywhere seems
> to just be a thinko?  All pseudos are dead somewhere!  (Yeah okay,
> infinite loops, but other than that.)
Yea, but the code which wipes the notes probably has no sense of where
in the RTL stream the note is valid and where it is not.  So it does the
fairly dumb thing and just ends up wiping them all away because as you
noted, most pseudos have a death somewhere.  One might argue that the
code is OK as-is, but just needs to be run later.  After cse2 would be
the most logical location since CSE is probably the heaviest user of the
notes.  But I'd worry that the problems referenced in c#2 of bz51505
could crop up in other contexts than just combine.

jeff


Reply via email to