On 11/07/12 13:41, Jakub Jelinek wrote:
> On Wed, Jul 11, 2012 at 12:30:12PM +0200, Tom de Vries wrote:
>> I've done the following:
>> - refactored the pass such that it now scans at most twice over all
>>   instructions.
>> - updated the patch to be applicable to current trunk
>> - updated the motivating example to a more applicable one (as discussed in
>>   this thread), and added that one as test-case.
>> - added a part in the header comment illustrating the working of the pass
>>   on the motivating example.
>>
>> bootstrapped and reg-tested on x86_64 and i686.
>>
>> build and reg-tested on mips, mips64, and arm.
> 
> How does this relate to the ree.c pass we already have?
> Why is not REE sufficient for you?  Having two different zero/sign extension
> elimination passes would be really wierd.
> 

Jakub,

pass_ree eliminates extensions by merging an extension with the definitions of
the register it extends. So pass_ree can perhaps be described as an inter-bb
combiner that is targeted at extensions.

AFAIU there is no analysis in pass_ree that concludes that an extension is
redundant. If it manages to combine an extension with all the insns feeding into
the extension, the extension has been made redundant.
Both redundant and non-redundant extensions can be eliminated by pass_ree.

pass_ee does an analysis of what parts of registers are used, and concludes
based on that analysis that an extension is redundant, meaning it can be
replaced by a regcopy without changing the semantics of the program.

We currently describe pass_ree as 'redundant extension elimination',
and pass_ee as 'extension elimination'.
Perhaps 'redundant extension elimination' is a more appropriate name for pass_ee
and pass_ree is better described as 'extension combiner'.

In the motivating example of the pass, there are 2 extensions. Those extensions
cannot be combined into the insns feeding into them (or into the insns they feed
into). They are redundant however, something which is analyzed by pass_ee. It
replaces the 2 extensions with regcopies, and in the resulting assembly the 2
redundant extensions are removed.

Thanks,
- Tom

>       Jakub
> 


Reply via email to