Patchwork [RFC,i386] : Remove peephole2s for (subreg (operator (...)(...))) RTXes

login
register
mail settings
Submitter Uros Bizjak
Date Oct. 29, 2012, 9:06 a.m.
Message ID <CAFULd4Z0z7+BF0vC7pvHvcx2NCOCSx76QzoatSDN62w1R0FvBw@mail.gmail.com>
Download mbox | patch
Permalink /patch/194916/
State New
Headers show

Comments

Uros Bizjak - Oct. 29, 2012, 9:06 a.m.
On Mon, Oct 29, 2012 at 9:07 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>>> As suggested by Richard S. [1], after the patch that converts subreg:M
>>>> (op:N (...)(...)) to op:M (subreg:M (...) subreg:M (...)), we can
>>>> remove several peephole2 patterns that handle subregs of PLUS, MINUS
>>>> and MULT operators. I have attached RFC prototype patch that will
>>>> trigger an ICE when to-be-removed pattern triggers, with the intention
>>>> that these patterns wil be removed entirely (An "invalid" pattern was
>>>> indeed generated elsewhere, see patch).
>
> I have committed following version that avoids all failures, reported by H.J.:
>
> 2012-10-29  Uros Bizjak  <ubizjak@gmail.com>
>
>         * config/i386/i386.c (ix86_decompose_address): Use simplify_gen_subreg
>         to generate SImode equivalent of address, zero-extended with AND RTX.
>         * config/i386/i386.md (ashift to lea splitter): Split to SImode mult.
>         (simple lea to add/shift peephole2s): Remove peephole2s that operate
>         on subregs of DImode operations.
>
> Re-tested on x86_64-pc-linux-gnu {,-m32} and committed to mainline SVN.

Oh, we don't have to use simplify_gen_subreg, gen_subreg is enough.

Patch committed as obvious to mainline SVN.

Uros.


> Uros.
Uros Bizjak - Oct. 29, 2012, 11:04 a.m.
On Mon, Oct 29, 2012 at 10:06 AM, Uros Bizjak <ubizjak@gmail.com> wrote:

>>>>> As suggested by Richard S. [1], after the patch that converts subreg:M
>>>>> (op:N (...)(...)) to op:M (subreg:M (...) subreg:M (...)), we can
>>>>> remove several peephole2 patterns that handle subregs of PLUS, MINUS
>>>>> and MULT operators. I have attached RFC prototype patch that will
>>>>> trigger an ICE when to-be-removed pattern triggers, with the intention
>>>>> that these patterns wil be removed entirely (An "invalid" pattern was
>>>>> indeed generated elsewhere, see patch).
>>
>> I have committed following version that avoids all failures, reported by H.J.:
>>
>> 2012-10-29  Uros Bizjak  <ubizjak@gmail.com>
>>
>>         * config/i386/i386.c (ix86_decompose_address): Use simplify_gen_subreg
>>         to generate SImode equivalent of address, zero-extended with AND RTX.
>>         * config/i386/i386.md (ashift to lea splitter): Split to SImode mult.
>>         (simple lea to add/shift peephole2s): Remove peephole2s that operate
>>         on subregs of DImode operations.
>>
>> Re-tested on x86_64-pc-linux-gnu {,-m32} and committed to mainline SVN.
>
> Oh, we don't have to use simplify_gen_subreg, gen_subreg is enough.

Not really, then we won't generate SUBREGs of pseudos...

Reverting the commit.

Uros.

Patch

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c  (revision 192908)
+++ config/i386/i386.c  (working copy)
@@ -11822,7 +11822,7 @@  ix86_decompose_address (rtx addr, struct ix86_addr
            }
          else if (GET_MODE (addr) == DImode)
            {
-             addr = simplify_gen_subreg (SImode, addr, DImode, 0);
+             addr = simplify_subreg (SImode, addr, DImode, 0);
              if (addr == NULL_RTX)
                return 0;
            }