[PATCH] D63653: [DAGCombine] narrowInsertExtractVectorBinOp - add CONCAT_VECTORS support

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 07:20:50 PDT 2019


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

I don't have a good sense of how we make fast-isel speed vs. perf trade-offs, so if anyone else has thoughts about that case, feel free to comment.

The optimization for regular combining overrides that concern for me, so LGTM.



================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:17910
+        V.getOperand(0).getValueType() == VT &&
+        IndexC->getAPIntValue().urem(VT.getVectorNumElements()) == 0) {
+      uint64_t SubIdx = IndexC->getZExtValue() / VT.getVectorNumElements();
----------------
I don't think it's possible for an extract index to be bigger than uint64_t given LLVM type limitations, so could go with the possibly more optimizable:
  IndexC->getZExtValue() % VT.getVectorNumElements() == 0


Repository:
  rL LLVM

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

https://reviews.llvm.org/D63653





More information about the llvm-commits mailing list