[llvm-commits] [llvm] r110576 - in /llvm/trunk: lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUISelLowering.h lib/Target/CellSPU/SPUInstrInfo.td lib/Target/CellSPU/SPUNodes.td lib/Target/CellSPU/SPURegisterInfo.cpp test/CodeGen/CellSP...
Chris Lattner
clattner at apple.com
Wed Aug 11 11:08:42 PDT 2010
On Aug 11, 2010, at 4:19 AM, Kalle.Raiskila at nokia.com wrote:
> On Tue, 2010-08-10 at 19:12 +0200, Bob Wilson wrote:
>> On Aug 10, 2010, at 3:53 AM, Kalle.Raiskila at nokia.com wrote:
>>> b) to the best of my understanding, v2i32 has to be legal if it is to be
>>> used in return values and function parameters.
>>
>> The types of return values and function parameters are also legalized. If you pass an argument with a non-legal type, it should be promoted or expanded to make it legal.
>
> The problem here was that v2i32 gets expanded to two i32s instead of
> promoted to one v4i32. Is it possible to force promotion somehow?
This is something that is on my plate to implement, but again, you can handle this in the frontend.
> Ok, I'll have a look. Just removing the v2i32 code from the SPU backend
> is simple. Getting it to be promoted instead of expanded... lets see...
Vector widening should already work (it does on x86 at least) for everything except arguments and return values.
> I wonder if I should have a go at trying to get i32 promoted to v4i32 at
> the same time :)
While interesting, I'd steer away from that. There are assumptions throughout the code generator that the pointer type is an integer etc.
>> Beyond Bob's post of "it should work", this is something that can
>> easily be handled by the frontend (by having the frontend lower v2i32
>> arg/ret values into v4i32 values with shufflevector to extract). This
>> is how the X86-64 backend handles its often-crazy ABI constraints.
>
> Certainly, when strict ABI compliance is required the frontend should do
> this lowering. However, not asserting on code that uses LLVM native
> types (including v2i32) would be nice. Especially as v2i32 is so easily
> mapped to v4i32.
Yes, I agree completely. This is something I'd also like on X86-64. It's on my todo list, but sadly my todo list isn't getting a lot of attention lately.
-Chris
More information about the llvm-commits
mailing list