[PATCH] D87215: [SelectionDAG][X86][ARM] Teach ExpandIntRes_ABS to use sra+add+xor expansion when ADDCARRY is supported.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 7 11:08:53 PDT 2020
craig.topper added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:2806
+ SDVTList VTList = DAG.getVTList(NVT, getSetCCResultType(NVT));
+ Lo = DAG.getNode(ISD::UADDO, dl, VTList, Lo, Sign);
+ Hi = DAG.getNode(ISD::ADDCARRY, dl, VTList, Hi, Sign, Lo.getValue(1));
----------------
RKSimon wrote:
> Do we need to test for UADDO legality?
I don't think so. In ExpandIntRes_ADDSUB we check ADDCARRY to choose UADDO/ADDCARRY legalization. If its not legal/custom we check if ADDC is legal/custom for to use ADDC/ADDE. If that doesn't work then we check if UADDO is legal to use UADDO/ADD.
I'm replicating the first part of that where we check ADDCARRY to use UADDO/ADDCARRY.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87215/new/
https://reviews.llvm.org/D87215
More information about the llvm-commits
mailing list