[PATCH] D149783: [DAGCombiner] Add bswap(logic_op(bswap(x), y)) optimization
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 4 05:18:43 PDT 2023
RKSimon added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:9987
+ // Need to ensure logic_op and bswap/bitreverse(x) doesn't have other uses
+ if (OldLHS.getOpcode() == Opcode && OldLHS.hasOneUse()) {
+ SDValue NewBitReorder = DAG.getNode(Opcode, DL, VT, OldRHS);
----------------
OldLHS might be from a node with multiple results - you need OldLHS->hasOneUse() (same for OldRHS below)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149783/new/
https://reviews.llvm.org/D149783
More information about the llvm-commits
mailing list