[PATCH] D96622: [DAG] PromoteIntRes_ADDSUBSHLSAT - use promoted ISD::USUBSAT directly

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 12:04:23 PST 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:810
+    return DAG.getNode(ISD::USUBSAT, dl, PromotedType, Op1Promoted,
+                       Op2Promoted);
   }
----------------
nikic wrote:
> Structurally, it might make sense to move the USUBSAT check before the `IsShift || TLI.isOperationLegalOrCustom(Opcode, PromotedType)` branch, as we'll now unconditionally take it. In that case you also don't need to change the shift code, and can keep the llvm_unreachable in there (not sure if you switch as written may generate warnings).
We could also just dispatch USUBSAT to PromoteIntRes_ZExtIntBinOp in the main switch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96622



More information about the llvm-commits mailing list