[PATCH] D148196: [SelectionDAG] Rename ADDCARRY/SUBCARRY to UADDO_CARRY/USUBO_CARRY

Sergei Barannikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 01:29:11 PDT 2023


barannikov88 added a comment.

In D148196#4264118 <https://reviews.llvm.org/D148196#4264118>, @craig.topper wrote:

>> ADDCARRY/SUBCARRY have been the only overflow-aware nodes for a long time.
>
> UADDO and USUBO are much older than ADDCARRY/SUBCARRY.

Thanks, I'll update the description. Do you maybe know the true reason for the discrepancy?



================
Comment at: llvm/include/llvm/CodeGen/ISDOpcodes.h:301
+  /// These opcodes are different from S{ADD,SUB}O_CARRY in that
+  /// U{ADD,SUB}O_CARRY produce a carry/borrow, whereas S{ADD,SUB}O_CARRY
+  /// produce an overflow.
----------------
craig.topper wrote:
> I think too many things got renamed here. The comparison to [US]{ADD,SUB}O matches the rest of the description.
The comparison with [US]{ADD,SUB}O is inaccurate.
The U version of these produces a carry (same as the former ADD/SUBCARRY),
the S version produces an overflow. The comment says they both produce an overflow.
I think the intention was to compare them with S{ADD,SUB}O_CARRY.

I'll revert this part so that this patch does not change the semantics of the comments.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148196/new/

https://reviews.llvm.org/D148196



More information about the llvm-commits mailing list