[PATCH] [Multiprecision Arithmetic Optimization] Teach SelectionDAG how to promote the integer carry result of {add, sub}{c, e} to a larger integer type.
Michael Gottesman
mgottesman at apple.com
Sat May 18 17:26:14 PDT 2013
On May 18, 2013, at 2:22 AM, Duncan Sands <duncan.sands at gmail.com> wrote:
> Hi Michael,
>
> On 17/05/13 23:33, Michael Gottesman wrote:
>> Hows this look Duncan/Sean?
>
> returning SDValue() in PromoteIntRes_ADDSUBC is not valid. There is no default
> method that can be fallen back to. If you don't want to handle the ResNo != 1
> case then you must assert/fail, not just return SDValue().
>
> Ciao, Duncan.
Hey Duncan,
In the updated patch are the changes that you requested (i.e. I am not just returning SDValue() in said patch). The lowering is done for all 4 types for ResNo == 1. I should have said something in the email enclosing the updated patch. My apologies for not being clearer.
Michael
>
>>
>>
>>
>>
>> Michael
>>
>> On May 16, 2013, at 10:41 AM, Michael Gottesman <mgottesman at apple.com
>> <mailto:mgottesman at apple.com>> wrote:
>>
>>> I am trying to be incremental and did not have a need for such lowering. On
>>> the other hand if you want I can implement that in this patch. Just state your
>>> preference = ).
>>>
>>> Michael
>>>
>>> On May 16, 2013, at 1:34 AM, Duncan Sands <duncan.sands at gmail.com
>>> <mailto:duncan.sands at gmail.com>> wrote:
>>>
>>>> Hi Michael,
>>>>
>>>> On 15/05/13 19:37, Michael Gottesman wrote:
>>>>> The attached patch teaches selection DAG how to promote the integer carry
>>>>> result of an {add,sub}{c,e} node to a larger integer type. It is a part of a
>>>>> larger set of patches that I will be committing over the next little bit to
>>>>> enable the optimization of uaddo/usubo chains.
>>>>>
>>>>> Please Review,
>>>>> Michael
>>>>
>>>> +SDValue DAGTypeLegalizer::PromoteIntRes_ADDSUBC(SDNode *N, unsigned ResNo) {
>>>> + if (ResNo == 1)
>>>> + return PromoteIntRes_Overflow(N);
>>>> + return SDValue();
>>>> +}
>>>> +
>>>> +SDValue DAGTypeLegalizer::PromoteIntRes_ADDSUBE(SDNode *N, unsigned ResNo) {
>>>> + if (ResNo == 1)
>>>> + return PromoteIntRes_Overflow(N);
>>>> + return SDValue();
>>>> +}
>>>>
>>>> why do you return SDValue() if ResNo != 1 ? Shouldn't you either assert or
>>>> promote the value?
>>>>
>>>> Ciao, Duncan.
>>>>
>>>> _______________________________________________
>>>> llvm-commits mailing list
>>>> llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
More information about the llvm-commits
mailing list