[PATCH] D103755: [DAG] Fold neg(bvsplat(neg(x)) -> bvsplat(x)

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 8 04:25:55 PDT 2021


sdesmalen 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(),
----------------
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).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103755/new/

https://reviews.llvm.org/D103755



More information about the llvm-commits mailing list