[PATCH] D147264: [DAG] Add SelectionDAG::SplitScalar helper
Sergei Barannikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 30 22:08:16 PDT 2023
barannikov88 added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:7431-7432
// Split the quotient into low and high parts.
- SDValue QuotL = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, HiLoVT, Quotient,
- DAG.getIntPtrConstant(0, dl));
- SDValue QuotH = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, HiLoVT, Quotient,
- DAG.getIntPtrConstant(1, dl));
+ SDValue QuotL, QuotH;
+ std::tie(QuotL, QuotH) = DAG.SplitScalar(Quotient, dl, HiLoVT, HiLoVT);
Result.push_back(QuotL);
----------------
(optional) It would be one line less with structured bindings.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147264/new/
https://reviews.llvm.org/D147264
More information about the llvm-commits
mailing list