[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:25:34 PDT 2010


On Aug 11, 2010, at 11:11 AM, Bob Wilson wrote:

> 
> 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?
> 
> The following code from TargetLowering::computeRegisterProperties() suggests that promotion should be the default:
> If that's not happening, you might want to step through that code and see why not.  Otherwise, you can specify promote vs. expand for each operation via TargetLowering::setOperationAction().

This isn't happening on X86 either, try running this through llc:

define <2 x float> @test1(<4 x float> %A) nounwind {
	%B = shufflevector <4 x float> %A, <4 x float> undef, <2 x i32> <i32 0, i32 1>
	%C = fadd <2 x float> %B, %B
	ret <2 x float> %C
}

The two floats are returned in XMM0/XMM1 instead of the low two elements of XMM0.

-Chris



More information about the llvm-commits mailing list