[PATCH] D158201: [DAG] Fold insert_subvector undef, (extract_subvector X, 0), 0 with non-matching types

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 18 11:35:55 PDT 2023


craig.topper added a comment.

LGTM other than the extra period.

The other comment can be addressed in a future patch.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:25601
+  // just use the input to the extract if the types match, and can simplify
+  // in some cases even if they don't..
   if (N0.isUndef() && N1.getOpcode() == ISD::EXTRACT_SUBVECTOR &&
----------------
Extra period at the end.


================
Comment at: llvm/test/CodeGen/RISCV/rvv/extract-subvector.ll:472
 ; CHECK-NEXT:    srli a0, a0, 2
+; CHECK-NEXT:    vsetvli zero, a0, e16, m1, ta, ma
+; CHECK-NEXT:    vslidedown.vx v13, v10, a0
----------------
This test case could be a single slidedown. Probably needs a special version of concat_vectors lowering. The rules on extract_subvector indices forced type legalization to make a concat of 3 extract_subvectors that are contiguous.


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

https://reviews.llvm.org/D158201



More information about the llvm-commits mailing list