[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
Thu May 16 10:41:51 PDT 2013


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130516/536f63b6/attachment.html>


More information about the llvm-commits mailing list