[PATCH] D42465: [RFC][CallingConv] Add CCAssignToRegWithType Calling Convention Interface

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 06:41:33 PST 2018


asb added a comment.

In https://reviews.llvm.org/D42465#994767, @shiva0217 wrote:

> Hi Alex, It seems that getRegisterTypeForCallingCon and relative hooks will split the type before assigning registers. Therefore, f64 will split into two i32. If two i32 types can't allocate to registers, it will generate two i32 load/stores.
>  Another case is that riscv ilp32d ABI will pass f64 by i32 registers if f64 registers are not available.  In this case, we have to do argument analysis to know there are no f64 registers left, then we assign to i32 registers.


Thanks for the explanation, the need to do this for corner cases of the ilp32d ABI is somewhat compelling. As you know from following the RISC-V patchset I do like the idea of handling as many ABI details as practicable in the backend. Being able to handle the f64 -> 2*i32 lowering in the backend still may not free the Clang frontend from having to count registers, as it may well be necessary for handling int+int or fp+int structs correctly.


Repository:
  rL LLVM

https://reviews.llvm.org/D42465





More information about the llvm-commits mailing list