[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 06:16:03 PST 2022


sdesmalen added a comment.

In D118459#3287061 <https://reviews.llvm.org/D118459#3287061>, @paulwalker-arm wrote:

> Just wanted to say that I'm not suggesting this patch implements the `binop(splat(x), not_splat(y))` -> `binop(not_splat(y), splat(x))` idea in one go.  I just think that if we agree that it's ultimately the better canonical form then I'm happy to accept this patch as a step in the right direction to unblock your current work and we can fix the rest up later (well sooner rather than later :) )

Okay that makes sense, thanks for clarifying!



================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5627
 
+void SelectionDAG::trySwapOpsCommutativeBinop(unsigned Opcode, SDValue &N1,
+                                              SDValue &N2) const {
----------------
RKSimon wrote:
> Sorry for bikeshedding - but maybe canonicalizeCommutativeBinop is a better name?
That's indeed a much better name, thank you :)


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