[cfe-commits] r134946 - in /cfe/trunk: lib/CodeGen/TargetInfo.cpp test/CodeGen/x86_64-arguments.c

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Mon Jul 11 18:28:51 PDT 2011


On Mon, Jul 11, 2011 at 5:37 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Mon, Jul 11, 2011 at 5:30 PM, Bruno Cardoso Lopes
> <bruno.cardoso at gmail.com> wrote:
>> Author: bruno
>> Date: Mon Jul 11 19:30:27 2011
>> New Revision: 134946
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=134946&view=rev
>> Log:
>> Fix one x86_64 abi issue and the test to actually look for the right thing,
>> which is: { <4 x float>, <4 x float> } should continue to go through memory.
>>
>> Modified:
>>    cfe/trunk/lib/CodeGen/TargetInfo.cpp
>>    cfe/trunk/test/CodeGen/x86_64-arguments.c
>>
>> Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=134946&r1=134945&r2=134946&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Mon Jul 11 19:30:27 2011
>> @@ -1228,6 +1228,13 @@
>>
>>     const RecordDecl *RD = RT->getDecl();
>>
>> +    // The only case a 256-bit wide vector could be used is when the struct
>> +    // contains a single 256-bit element. Since Lo and Hi logic isn't extended
>> +    // to work for sizes wider than 128, early check and fallback to memory.
>> +    RecordDecl::field_iterator FirstElt = RD->field_begin();
>> +    if (Size > 128 && getContext().getTypeSize(FirstElt->getType()) != 256)
>> +      return;
>
> What if FirstElt is a struct/array/etc?

This test should be extended for arrays, done in r134951, thanks for
the catch. But for structs it will still yield the correct result
because the test fails until it finds the first struct whose first
element is different from 256.

-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc




More information about the cfe-commits mailing list