[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
Fri May 17 14:33:33 PDT 2013


Hows this look Duncan/Sean?



Michael

On May 16, 2013, at 10:41 AM, Michael Gottesman <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> 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
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> _______________________________________________
> 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/20130517/5068a7f0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Teach-SelectionDAG-how-to-promote-the-integer-argume.patch
Type: application/octet-stream
Size: 4564 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130517/5068a7f0/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130517/5068a7f0/attachment-0001.html>


More information about the llvm-commits mailing list