[PATCH] D118919: [DAGCombiner] Fold vecreduce_or/and if operand is insert_subvector.

Bradley Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 3 09:28:22 PST 2022


bsmith accepted this revision.
bsmith added a comment.
This revision is now accepted and ready to land.

LGTM with minor nits.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:22519-22520
 
+  // vecreduce_or(insert_subvector(zero, val)) -> vecreduce_or(val)
+  // vecreduce_or(insert_subvector(undef, val)) -> vecreduce_or(val)
+  if (N0.getOpcode() == ISD::INSERT_SUBVECTOR &&
----------------
Nit: This comment doesn't mention the AND case.


================
Comment at: llvm/test/CodeGen/AArch64/sve-vecreduce-fold.ll:50
+
+define i1 @reduce_and_insert_subvec_into_zero(<vscale x 4 x i1> %in) {
+; CHECK-LABEL: reduce_and_insert_subvec_into_zero:
----------------
Nit: Should be _ones?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118919



More information about the llvm-commits mailing list