[PATCH] D82582: [SVE] Remove calls to VectorType::getNumElements from clang

Cullen Rhodes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 24 02:06:38 PDT 2020


c-rhodes added a comment.

there's a few places the `getNumElements` calls can be fixed by getting the initial cast right



================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:5986
   case NEON::BI__builtin_neon_vqrdmulh_lane_v: {
     auto *RTy = cast<llvm::VectorType>(Ty);
     if (BuiltinID == NEON::BI__builtin_neon_vqdmulhq_lane_v ||
----------------
cast here


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:9872
   case NEON::BI__builtin_neon_vfma_laneq_v: {
     llvm::VectorType *VTy = cast<llvm::VectorType>(Ty);
     // v1f64 fma should be mapped to Neon scalar f64 fma
----------------
cast here


================
Comment at: clang/lib/CodeGen/CGExpr.cpp:1765
   }
   auto *VectorTy = dyn_cast<llvm::VectorType>(
       cast<llvm::PointerType>(Addr.getPointer()->getType())->getElementType());
----------------
cast here


================
Comment at: clang/lib/CodeGen/CGExpr.cpp:1799
       llvm::Type *SrcTy = Value->getType();
       auto *VecTy = dyn_cast<llvm::VectorType>(SrcTy);
       // Handle vec3 special.
----------------
cast here


================
Comment at: clang/lib/CodeGen/CGExpr.cpp:2214
   if (const VectorType *VTy = Dst.getType()->getAs<VectorType>()) {
     unsigned NumSrcElts = VTy->getNumElements();
     unsigned NumDstElts =
----------------
missed one here


================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:1638
 
     llvm::VectorType *MTy = cast<llvm::VectorType>(Mask->getType());
 
----------------
cast here


================
Comment at: clang/lib/CodeGen/SwiftCallingConv.cpp:321
   // If we have a vector type, split it.
   if (auto vecTy = dyn_cast_or_null<llvm::VectorType>(type)) {
     auto eltTy = vecTy->getElementType();
----------------
cast here


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82582





More information about the cfe-commits mailing list