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

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 18 16:32:30 PDT 2023


craig.topper added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenTypes.cpp:632
+#define RVV_TYPE(Name, Id, SingletonId)                                        \
+  case BuiltinType::Id: {                                                      \
+    ASTContext::BuiltinVectorTypeInfo Info =                                   \
----------------
Why did this code need to move into the macro body? It was written the way it was before to avoid code duplication.


================
Comment at: clang/lib/CodeGen/CodeGenTypes.cpp:641
+  case BuiltinType::Id: {                                                      \
+    ASTContext::BuiltinVectorTypeInfo Info =                                   \
+        Context.getBuiltinVectorTypeInfo(cast<BuiltinType>(Ty));               \
----------------
Can you unify tuple and non-tuple by checking Info.NumVectors != 1?


================
Comment at: clang/lib/CodeGen/CodeGenTypes.cpp:645
+        ConvertType(Info.ElementType), Info.EC.getKnownMinValue());            \
+    llvm::SmallVector<llvm::Type *, 4> EltTys;                                 \
+    for (unsigned I = 0; I < Info.NumVectors; ++I)                             \
----------------
`llvm::SmallVector<llvm::Type *, 4> EltTys(Info.NumVectors, EltTy)`


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