[PATCH] D82910: [CodeGen][SVE] Don't drop scalable flag in DAGCombiner::visitEXTRACT_SUBVECTOR

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 30 14:09:25 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:19221
     unsigned SrcNumElts = SrcVT.getVectorNumElements();
     unsigned DestNumElts = V.getValueType().getVectorNumElements();
     if ((SrcNumElts % DestNumElts) == 0) {
----------------
While we're here, do we need to change these getVectorNumElements() calls to getVectorElementCount()?


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:19238
       if ((NVT.getVectorNumElements() % DestSrcRatio) == 0) {
-        unsigned NewExtNumElts = NVT.getVectorNumElements() / DestSrcRatio;
+        ElementCount NewExtEC = NVT.getVectorElementCount() / DestSrcRatio;
         EVT ScalarVT = SrcVT.getScalarType();
----------------
Does this math work correctly if we're extracting a fixed vector from a scalable vector?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82910





More information about the llvm-commits mailing list