[PATCH] D146873: [2/11][POC][Clang][RISCV] Define RVV tuple types

Yueh-Ting (eop) Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 18 10:39:44 PDT 2023


eopXD added inline comments.


================
Comment at: clang/lib/CodeGen/CGCall.cpp:3135
           STy->getNumElements() > 1) {
-        uint64_t SrcSize = CGM.getDataLayout().getTypeAllocSize(STy);
-        llvm::Type *DstTy = Ptr.getElementType();
-        uint64_t DstSize = CGM.getDataLayout().getTypeAllocSize(DstTy);
+        if (STy->containsScalableVectorType()) {
+          assert(STy->containsHomogeneousScalableVectorTypes() &&
----------------
craig.topper wrote:
> Can we call `CGM.getDataLayout().getTypeAllocSize(STy)` and check if the TypeSize returned isScalable instead of calling containsScalableVectorType?
Switched to using `CGM.getDataLayout().getTypeAllocSize(STy)`, though calling `containsScalableVectorType` won't cost too much because the function has memoization.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146873



More information about the cfe-commits mailing list