This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add new target-hook truncated_to_mode


Richard Sandiford wrote:



I don't think that's workable for the case at hand. The information
provided by the hook is going to be used before register allocation,
where most of the heavy-duty rtl optimisation happens. I don't think
we can reasonably keep tabs on which values have been made subject to
the assumption and which haven't, and use that information to constrain
register allocation.


I was more thinking along the lines of leaving the operation in, but considering
it free.
E.g. we could have register_operand accept SIGN_EXTEND if the hook
says that for the mode pair involved this is a no-op for GENRAL_REGS;
for strict matching, we'd enforce the register class, and might need reloads
if we have the wrong class.
This is really very similar to what we do currently with SUBREG, except
that we leave the information in the RTL what the operation performed
actually is.


Likewise, some problems with LOAD_EXTEND_OP would probably go
away if we changed the loads to say what we intend them to mean, i.e.
when we expect a 64-bit sign extended value for a 32 bit load,
we should change
(set (reg:SI foo) (mem:SI bar))
into:
(set (subreg:DI (reg:SI (foo)) (sign_extend:DI (mem:SI (bar)))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]