[PATCH] D29872: Do not legalize large add with addc/adde, introduce addcarry and do it with uaddo/addcarry

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 17 05:25:49 PDT 2017


mkazantsev added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:1785
 
+  bool hasOPCARRY = TLI.isOperationLegalOrCustom(
+      N->getOpcode() == ISD::ADD ? ISD::ADDCARRY : ISD::SUBCARRY,
----------------
hasOpCarry? By analogy with hasCarry below.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:1941
+
+  bool hasOPCARRY = TLI.isOperationLegalOrCustom(
+      N->getOpcode() == ISD::ADD ? ISD::ADDCARRY : ISD::SUBCARRY,
----------------
hasOpCarry?


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:1968
+    // Calculate the overflow: addition overflows iff a + b < a, and subtraction
+    // overflows iff a - b > a.
+    auto Cond = N->getOpcode() == ISD::UADDO ? ISD::SETULT : ISD::SETUGT;
----------------
iff -> if?


https://reviews.llvm.org/D29872





More information about the llvm-commits mailing list