[PATCH] D74386: [SVE] Update API ConstantVector::getSplat() to use ElementCount.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 13:35:20 PDT 2020


efriedma added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:4497
 Value *CodeGenFunction::EmitNeonSplat(Value *V, Constant *C) {
-  unsigned nElts = V->getType()->getVectorNumElements();
-  Value* SV = llvm::ConstantVector::getSplat(nElts, C);
+  auto EC = V->getType()->getVectorElementCount();
+  Value *SV = llvm::ConstantVector::getSplat(EC, C);
----------------
Please write out the type ElementCOunt.


================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:6542
 
-    unsigned End = getTransitionType()->getVectorNumElements();
+    auto EC = getTransitionType()->getVectorElementCount();
     if (UseSplat)
----------------
Please write out the type ElementCount.

This is unfortunately turning the explicit assertion if the type is scalable into a later verifier failure in the case where it isn't a splat.  Please either fix it properly, or change it so the non-splat codepath still asserts.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74386





More information about the llvm-commits mailing list