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

Duncan Sands duncan.sands at gmail.com
Thu May 16 01:34:12 PDT 2013


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.




More information about the llvm-commits mailing list