[PATCH] [Multiprecision Arithmetic Optimization] Teach SelectionDAG how to promote the integer carry result of {add, sub}{c, e} to a larger integer type.

Owen Anderson resistor at mac.com
Wed May 15 14:04:10 PDT 2013


LGTM, with two comments:

> -  SDValue Ops[] = { N->getOperand(0), N->getOperand(1) };
> +  const unsigned NumOperands = N->getNumOperands();
> +  SDValue Ops[3] = { N->getOperand(0), N->getOperand(1) };
> +  if (NumOperands == 3)
> +    Ops[2] = N->getOperand(2);

It took me a while to figure out what case this was handling.  Perhaps it merits a comment?

Second, is it possible to write a test for this functionality?  I know that there are dependent patches incoming, but it would be good to test each patch independently as much as possible.

--Owen

On May 15, 2013, at 10:37 AM, Michael Gottesman <mgottesman at apple.com> 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
> 
> <0001-Teach-SelectionDAG-how-to-promote-the-integer-carry-.patch>
> 
> _______________________________________________
> 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