[PATCH] D103755: [DAG] Fold neg(bvsplat(neg(x)) -> bvsplat(x)
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 21 00:12:53 PDT 2021
dmgreen added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3313
+ // Fold neg(bvsplat(neg(x)) -> bvsplat(x)
+ if (N1.getOpcode() == ISD::BUILD_VECTOR &&
+ llvm::all_of(N1->ops(),
----------------
sdesmalen wrote:
> Can `SelectionDAG::getSplatValue()` be used here? If so, then this doesn't need to be limited to BUILD_VECTOR, as it seems this fold would work equally well for scalable vectors (which use SPLAT_VECTOR).
Thanks for taking a look. Yeah, seems to work OK. I'll make it so.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103755/new/
https://reviews.llvm.org/D103755
More information about the llvm-commits
mailing list