[PATCH] D81500: [SVE] Remove calls to VectorType::getNumElements from IR

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 12:53:26 PDT 2020


ctetreau marked an inline comment as done.
ctetreau added inline comments.


================
Comment at: llvm/include/llvm/IR/MatrixBuilder.h:47
       LHS = B.CreateVectorSplat(
-          cast<VectorType>(RHS->getType())->getNumElements(), LHS,
+          cast<FixedVectorType>(RHS->getType())->getNumElements(), LHS,
           "scalar.splat");
----------------
RKSimon wrote:
> RKSimon wrote:
> > Do we not have a method for creating splat vectors that works for fixed and non-fixed vector types?
> I think CreateVectorSplat needs to be altered to take a ElementCount type instead of a raw unsigned elt count - are you in a position to do this first?
The change to CreateVectorSplat is actually fairly trivial. ElementCount can just be used in place of an unsigned within its body and signature. I can certainly make the change, but I'd prefer to do it separate from this patch because:

1) it's a behavior change that needs tests
2) as far as I can tell, none of this matrix stuff supports scalable vectors, so making this change would have low practical value


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81500





More information about the llvm-commits mailing list