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

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 04:24:41 PST 2022


paulwalker-arm added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5643
+  // Canonicalize:
+  //  binop(splat(X), stepvector) -> binop(stepvector, splat(X))
+  //
----------------
sdesmalen wrote:
> 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?
Not sure I understand what you're saying here.  Doesn't this just mean there's code that needs to be changed to check for the new canonical form?


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