This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: reload infrastructure to fix PR target/21623
Joern Rennecke wrote:
Joern Rennecke wrote:
P.S.: We could make it a target hook, and have the default definition
use reload_{in,out} optab.
Then we add the use of reload_{in,out}<mode> patterns to our list of
obsolescent port features.
P.P.S.:
We can't actually do that easily, because when we only need a simple
temporary registers, we
currently name the register class, without there being a pattern. Now
we'll need patterns
that guide us to find the right class.
It can still be done, but it will require auto-generating input and
output expanders for every register
class for any target that defines SECONDARY*_RELOAD_CLASS. To be more
precise, we can use gen_move_insn as the generator function, but we need
entries in insn_data
with the appropriate predicates. We can get away without having one for
every mode if we allow
VOIDmode to match any mode.
Since we need these autogenerated patterns for the conversion, we might
as well have them
universally so that port writers can refer to them, rather than have to
code them explicitly.
I was thinking of using reload_{in,out}__ with the secondary reload
register class name
appended, e.g. for a secondary input reload class of GENERAL_REGS we'll use
code_for_reload_in__GENERAL_REGS, and this icode corrosponds to data that is
equivalent to:
(define_expand "reload_in__GENERAL_REGS"
[(set (match_operand 0 "" "=r") (match_operand 1 "" "")]
""
"")
However, this is still awkward, because you'll have to duplicate a lot
of code between input and
output reloads. We should have patterns that have the constraint on
both sides. However,
if we handled these like the other patterns. we'd end up with a no-op
move for the reload
register. I think the simplest solution is keep the expander function
field NULL, and in
push_secondary_reload, take this to mean that we can do this reload
without a special expander
(we can use gen_rtx_SET).
So since the distinction between in and out would get in the way, the
pseudo patterns
would be reload__ with the class name appended, e.g. for GENERAL_REGS
roughly
equivalent to:
(define_expand "reload__GENERAL_REGS"
[(set (match_operand 0 "" "=r") (match_operand 1 "" "r")]
""
"")
Would a patch along these lines be acceptable?