[PATCH] D95967: [DAGCombiner][SVE] Fix invalid use of getVectorNumElements() in visitSRA.

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 4 03:34:44 PST 2021


paulwalker-arm added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:8364-8365
     if (VT.isVector())
-      ExtVT = EVT::getVectorVT(*DAG.getContext(),
-                               ExtVT, VT.getVectorNumElements());
+      ExtVT = EVT::getVectorVT(*DAG.getContext(), ExtVT,
+                               VT.getVectorElementCount());
     if (!LegalOperations ||
----------------
Just a thought but in general it seems like a good way to mitigate such issues is to remove any explicit vector length handling and thus I'm wondering if it's worth changing this and the other instances to use changeVectorElementType (i.e. `VT.changeVectorElementType(ExtVT)` in this instance). It might even reduce line wrapping and thus read better.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95967



More information about the llvm-commits mailing list