This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH 1/5] Handle WORD_REGISTER_OPERATIONS when reloading (subreg(reg))
- From: Matthew Fortune <Matthew dot Fortune at imgtec dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>, Richard Sandiford <richard dot sandiford at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Christophe Lyon <christophe dot lyon at linaro dot org>, Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>, Vladimir Makarov <vmakarov at redhat dot com>, Robert Suchanek <Robert dot Suchanek at imgtec dot com>, "Moore, Catherine (Catherine_Moore at mentor dot com)" <Catherine_Moore at mentor dot com>
- Date: Tue, 21 Feb 2017 19:53:24 +0000
- Subject: RE: [PATCH 1/5] Handle WORD_REGISTER_OPERATIONS when reloading (subreg(reg))
- Authentication-results: sourceware.org; auth=none
- References: <6D39441BF12EF246A7ABCE6654B0235380B5CE7E@hhmail02.hh.imgtec.org> <6D39441BF12EF246A7ABCE6654B0235380B6FB45@hhmail02.hh.imgtec.org> <87o9xvh0k5.fsf@e105548-lin.cambridge.arm.com> <1606998.MhajK6QH46@polaris>
Eric Botcazou <ebotcazou@adacore.com> writes:
> > Agreed. I don't think things like WORD_MODE_OPERATIONS should change
> > rtl semantics, just optimisation decisions.
Sorry, I did cover two topics in one email. My point was about whether
simplifying:
(subreg:OUTER (mem:INNER ...))
To:
(mem:OUTER ...)
Should ever be a requirement for successful reloading rather than just an
optimisation that 'could' be applied. There are a few cases it seems that
require this simplification to happen which I find odd.
> > And using the smallest
> > possible spill size is often good even for RISCy targets.
Yes, if (subreg(mem)) simplification only ever happened when it was reducing
the size of the load/store I would understand the code more too but actually
it will currently happily simplify to a wider mode. Using a wider mode may
well be beneficial in other situations where a further reload would be needed
due to insn constraints I guess. It all feels a bit like magic still.
> I don't think that's correct, WORD_MODE_OPERATIONS does change RTL semantics
> for SUBREGs smaller than a word since it can make all bits defined, even if
> only the lower part is assigned. For example (SUBREG:SI (MEM:QI)) has the
> higher bits defined according to LOAD_EXTEND_OP if WORD_MODE_OPERATIONS.
It would almost be simpler if we had another variant of subreg (like we have
strict_low_part) to explicitly represent the WORD_REGISTER_OPERATIONS behaviour
with the mode change. I'll stop myself and hold this for later though!
> LRA simply needs to preserve the semantics, just as reload does.
I will keep working on this code post GCC 7 as the topic is bugging me now :-)
Thanks,
Matthew