[PATCH] D131503: [DAGCombine] Combine signext_inreg of extract-extend

Peter Waller via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 04:57:14 PDT 2022


peterwaller-arm added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:13170
+      SDValue SignExtExtendee =
+          DAG.getNode(ISD::SIGN_EXTEND, SDLoc(N), InnerExtVT, Extendee);
+      return DAG.getNode(ISD::EXTRACT_SUBVECTOR, SDLoc(N), VT, SignExtExtendee,
----------------
RKSimon wrote:
> Does this need an operation legality check for ISD::SIGN_EXTEND ? `(!LegalOperations || TLI.isOperationLegal(ISD::SIGN_EXTEND, InnerExtVT))`?
The combine only replaces an extant any-extend with an equivalent sign-extend. Is it an unreasonable assumption that if a target supports an any-extend it won't support the equivalent sign or zero extend? I can add the condition if you think this is suspect.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131503



More information about the llvm-commits mailing list