[llvm-dev] [Sparc] Lowering of Complex number for ABI compliance

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 2 09:46:59 PDT 2016


On 2 June 2016 at 08:42, Chris.Dewhurst via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Ultimately, the question is: What changes would need to be made to
>   (a) the front-end, to propagate this information into the back-end.
>   (b) the back-end, to be able to detect this information and treat the
> function call ABI differently?

It looks like LLVM already returns {double, double} in float
registers, doesn't it? If so, you ought to be able to just make Clang
emit complex returns as that instead of an sret parameter. Roughly: in
lib/CodeGen/TargetInfo.cpp, SparcV9ABIInfo::computeInfo check for a
complex type and return getDirect for it.

Cheers.

Tim.


More information about the llvm-dev mailing list