[llvm-commits] [PATCH] Fix PR13220

Duncan Sands baldrick at free.fr
Thu Jul 12 02:02:26 PDT 2012


Hi Michael, thanks for the patch.  I've applied it with some small tweaks
in commit 160116.

Ciao, Duncan.

On 12/07/12 10:13, Michael Liao wrote:
> Sorry, the root casue of PR13220 is that, during result expansion on
> EXTRACT_VECTOR_ELT, the current logic assumes the input vector element
> type is the same as the return type. It breaks the fact you just pointed
> out. Here is the latest patch fixing the the result expansion of
> EXTRACT_VECTOR_ELT.
>
> Yours
> - Michael
>
> On Thu, 2012-07-12 at 09:52 +0200, Duncan Sands wrote:
>> Hi Michael,
>>
>>> Yeah, you're right. But, if the promoted type is not legal, i.e.
>>> extended type. The result extending assumes the bit-width of the
>>> extracted data is the same as the element of the input vector.
>>
>> I was unable to parse these sentences.  Can you please say it again
>> differently.
>>
>> Thanks, Duncan.
>>
>>    Here is
>>> the latest patch distinguishing whether the promoted data result is
>>> legal or not. When the promoted data type is extended one, just
>>> any-extend the input vector first and then extract element; otherwise,
>>> just follow the previous behavior.
>>>
>>> Yours
>>> - Michael
>>>
>>> On Thu, 2012-07-12 at 09:18 +0200, Duncan Sands wrote:
>>>> Hi Michael,
>>>>> Please review the attached patch fixing PR13220. With this patch, the
>>>>> test case in PR13220 is passed as well as 'make check-all'. Test cases
>>>>> are included in this patch.
>>>>
>>>> it is legal for EXTRACT_VECTOR_ELT to return a wider type than the input
>>>> vector element type.  Here's the doc from ISDOpcodes.h:
>>>>
>>>>        /// EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR
>>>>        /// identified by the (potentially variable) element number IDX.  If the
>>>>        /// return type is an integer type larger than the element type of the
>>>>        /// vector, the result is extended to the width of the return type.
>>>>        EXTRACT_VECTOR_ELT,
>>>>
>>>> So if this is causing crashes then the bug is probably somewhere else, in some
>>>> code that isn't expecting this.
>>>>
>>>> Ciao, Duncan.
>>>> _______________________________________________
>>>> llvm-commits mailing list
>>>> llvm-commits at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>
>>
>>
>





More information about the llvm-commits mailing list