[PATCH] D93043: [CostModel] Add costs for llvm.experimental.vector.{extract,insert} intrinsics

Bradley Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 03:09:15 PST 2020


bsmith added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/BasicTTIImpl.h:121
            "Can only extract subvectors from vectors");
     int NumSubElts = SubVTy->getNumElements();
+    assert((!isa<FixedVectorType>(VTy) ||
----------------
CarolineConcatto wrote:
> If this starts to accept scalable vector, by replacing FixedVectorType to VectorType, this could be a problem. 
> See this function unsigned VectorType::getNumElements() const; inDerivedTypes.h
> Maybe you will need to use InstructionCost class or just assert at the moment when the type is scalable
Is adding another assert is really necessary? In my mind if someone changed SubVTy from FixedVectorType to VectorType they should also make this function support scalable vectors.

The fact that SubVTy is a FixedVectorType means there already is an assert and statement that this function doesn't support scalable vectors for SubVTy.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93043



More information about the llvm-commits mailing list