[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 03:23:03 PST 2022
paulwalker-arm added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5629
+ SDValue &N2) const {
+ // Canonicalize constant to RHS if commutative.
+ if (!TLI->isCommutativeBinOp(Opcode))
----------------
This comment is now out of date. I'd just remove the comment given you've moved the code into a function with `CommutativeBinop` in the name.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5643
+ // Canonicalize:
+ // binop(splat(X), stepvector) -> binop(stepvector, splat(X))
+ //
----------------
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.
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