[PATCH] D83602: [DAGCombiner] Scalarize splats with just one demanded lane

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 13:40:29 PDT 2020


spatel added reviewers: RKSimon, craig.topper.
spatel added a comment.

Would it make sense to generalize or add a TLI hook similar to the one used in scalarizeExtractedBinop()?

  /// Try to convert an extract element of a vector binary operation into an
  /// extract element followed by a scalar operation.
  virtual bool shouldScalarizeBinop(SDValue VecOp) const;



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:17677-17679
+  case ISD::ADD:
+  case ISD::SUB:
+  case ISD::AND: {
----------------
Why only these 3 binops?
Could this be TLI.isBinOp(Opc) instead?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83602





More information about the llvm-commits mailing list