[llvm] r244889 - [SystemZ] Support large LLVM IR struct return values

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 08:58:13 PDT 2015


Hi Hans,

if there's still time, I think it would be good to merge this
patch to the 3.7 branch, since it fixes a crash when running
current Mesa/llvmpipe and is a relatively straightforward fix.

Thanks,
Ulrich

>[SystemZ] Support large LLVM IR struct return values
>
>Recent mesa/llvmpipe crashes on SystemZ due to a failed assertion when
>attempting to compile a routine with a return type of
>  { <4 x float>, <4 x float>, <4 x float>, <4 x float> }
>on a system without vector instruction support.
>
>This is because after legalizing the vector type, we get a return value
>consisting of 16 floats, which cannot all be returned in registers.
>
>Usually, what should happen in this case is that the target's
CanLowerReturn
>routine rejects the return type, in which case SelectionDAG falls back to
>implementing a structure return in memory via implicit reference.
>
>However, the SystemZ target never actually implemented any CanLowerReturn
>routine, and thus would accept any struct return type.
>
>This patch fixes the crash by implementing CanLowerReturn.  As a side
effect,
>this also handles fp128 return values, fixing a todo that was noted in
>SystemZCallingConv.td.



More information about the llvm-commits mailing list