On 9/18/23 19:41, Jeff Law wrote:
On 9/18/23 13:45, Vineet Gupta wrote:

For the cases which do require sign extends, but not being eliminated due to "missing definition(s)" I'm working on adapting Ajit's REE ABI interfaces work [2] to work for RISC-V as well.
I wonder if we could walk the DECL_ARGUMENTS for current_function_decl and create sign extensions for integer arguments smaller than XLEN at the start of the function.  Record them in a list.

Then we just let the rest of REE do its thing.  When REE is done we go back and delete those sign extensions we created.

Umm, not sure I follow: the need for creating more sign extends.

At least for test in PR/111466 one's already present, at the entry for REE. And given these are hard regs, Ajit's code is able to identify them as functions args or return etc.

Assuming that works, then we just need to conditionalize the code on ABI properties.

Right, in the production version it could be a new target hook. For power it would be true for ZERO_EXTEND, for RISC-V true for sign_Extend etc. As of now ive hacked Ajit's patch to check for both of them. It seems to be doing something.

However in my current approach I'm trying to not have to do this in ree at all if we can remove these at expand time. RISC-V doesn't have TARGET_PROMOTE_PROTOTYPES, but per documentation it is needed for types smaller than int. This case already has int. I'm trying to wrap my head around PROMOTE_MODE and TARGET_PROMOTE_FUNCTION_MODE.

Thx,
-Vineet

Reply via email to