[PATCH] D118920: [DAGCombiner] Fold `ty1 extract_vector(ty2 splat(V)) -> ty1 splat(V)`

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 5 06:03:50 PST 2022


sdesmalen marked an inline comment as done.
sdesmalen added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:21022
+  // ty1 extract_vector(ty2 splat(V))) -> t1 splat(V)
+  if (NVT.isScalableVector() == V.getValueType().isScalableVector() &&
+      V.getOpcode() == ISD::SPLAT_VECTOR)
----------------
frasercrmck wrote:
> I'm wondering, do we really need both to be equally scalable? Or is this just to avoid introducing a fixed-length SPLAT_VECTOR which we don't have great support for? If it's a "workaround" of that sort, might be worth commenting.
Good point, I was mostly trying to be conservative, but when removing the condition everything still works as expected.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118920



More information about the llvm-commits mailing list