[PATCH] D118459: [ISEL] Canonicalize STEP_VECTOR to LHS if RHS is a splat.

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 04:14:12 PST 2022


sdesmalen added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5643
+  // Canonicalize:
+  //  binop(splat(X), stepvector) -> binop(stepvector, splat(X))
+  //
----------------
paulwalker-arm wrote:
> What about changing this to `binop(splat(x), not_splat(y))` -> `binop(not_splat(y), splat(x))`?  That would solve your problem and be truly canonical.
> 
Unfortunately that has other side-effects, e.g. for:

   getelementptr i8, i8* %base, <vscale x 2 x i32> %offsets

This would swap the `splat(%base)` and `%offsets` so that getUniformBase no longer recognises the %base as the scalar base pointer.

I wonder if this means the proposed canonicalisation is too specific, and therefore not worth it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118459



More information about the llvm-commits mailing list