[llvm-commits] TargetData support for alignment of degenerate vectors

Chris Lattner clattner at apple.com
Sun Apr 22 14:26:37 PDT 2007


Looks good to me, plz apply, Thanks!

-Chris

On Apr 22, 2007, at 12:32 PM, Christopher Lamb wrote:

> This patch was buried at the end of the discussion...
>
> --
> Christopher Lamb
>
> Begin forwarded message:
>
>> From: Christopher Lamb <christopher.lamb at gmail.com>
>> Date: April 22, 2007 4:12:29 AM CDT
>> To: CVS Commit Messages for LLVM repository <llvm- 
>> commits at cs.uiuc.edu>
>> Subject: Re: [llvm-commits] Major regressions
>>
>> On Apr 22, 2007, at 1:40 AM, Chris Lattner wrote:
>>
>>>
>>> On Apr 21, 2007, at 4:28 PM, Christopher Lamb wrote:
>>>
>>>>
>>>> On Apr 21, 2007, at 6:12 PM, Reid Spencer wrote:
>>>>
>>>>> On Sat, 2007-04-21 at 18:07 -0500, Christopher Lamb wrote:
>>>>>> I'm getting a regression after my fixes that's coming from
>>>>>> getABIAlignment not finding an alignment to use for a <float x1>
>>>>>> type,
>>>>>> is this a bug?
>>>>>
>>>>> It could be. <float x 1> isn't a useful vector so it probably  
>>>>> doesn't
>>>>> have an ABI Alignment. It should, however, default to whatever the
>>>>> target's alignment is for float. Perhaps that case isn't  
>>>>> covered in
>>>>> TargetData or there's something else wrong with TargetData?
>>>>>
>>>>> Did you walk through it in the debugger?
>>>>
>>>> Yes. It appears that TargetData doesn't have logic to match the  
>>>> case
>>>> of vector types smaller than the smallest defined ABI vector type.
>>>> It's asserting in TargetData::getAlignmentInfo:
>>>>
>>>> assert(BestMatchIdx != -1 && "Didn't find alignment info for this
>>>> datatype!");
>>>
>>> Ahh.
>>>
>>>> I don't think it has enough information to be able to determine
>>>> whether or not it's being asked for the alignment of a smaller  
>>>> vector
>>>> type that could be mapped onto a non-vector type.
>>>>
>>>> My feeling is that in this case getAlignmentInfo should return a
>>>> conservative fallback alignment the same way that's done for  
>>>> integers.
>>>
>>> I think it should fall back to the ABI alignment of the scalar type.
>>> If a target doesn't have an entry for a vector type, we can assume
>>> that it will be scalarized.
>>
>> Here's a patch to do it.
>> --
>> Christopher Lamb
>>
> <degenerate_vectors.diff>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070422/49c837e0/attachment.html>


More information about the llvm-commits mailing list