[PATCH] D68123: [CodeGen][SelectionDAG] Fix tiny bug in ExpandIntRes_UADDSUBO
Itay Bookstein via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 27 02:05:34 PDT 2019
ibookstein created this revision.
ibookstein added a reviewer: bogner.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
Ternary expression checks for ISD::ADD instead of ISD::UADDO inside DAGTypeLegalizer::ExpandIntRes_UADDSUBO.
This means the ternary expression will evaluate to ISD::SUBCARRY for both ISD::UADDO and ISD::USUBO nodes.
Targets are likely to implement both, so impact will be very limited in practice.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D68123
Files:
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -2258,7 +2258,7 @@
SDValue Ovf;
bool HasOpCarry = TLI.isOperationLegalOrCustom(
- N->getOpcode() == ISD::ADD ? ISD::ADDCARRY : ISD::SUBCARRY,
+ N->getOpcode() == ISD::UADDO ? ISD::ADDCARRY : ISD::SUBCARRY,
TLI.getTypeToExpandTo(*DAG.getContext(), LHS.getValueType()));
if (HasOpCarry) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68123.222098.patch
Type: text/x-patch
Size: 568 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190927/8a716cf3/attachment.bin>
More information about the llvm-commits
mailing list