[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 24 08:30:42 PDT 2025


================
@@ -164,7 +164,8 @@ QualTypeMapper::convertArrayType(const clang::ArrayType *AT) {
 /// \return LLVM ABI VectorType with element type, count, and alignment
 const llvm::abi::Type *QualTypeMapper::convertVectorType(const VectorType *VT) {
   const llvm::abi::Type *ElementType = convertType(VT->getElementType());
-  uint64_t NumElements = VT->getNumElements();
+  llvm::ElementCount NumElements =
+      llvm::ElementCount::getFixed(VT->getNumElements());
----------------
nikic wrote:

I think this is right. VectorType only supports fixed vectors (this is used for generic `__attribute__((vector_size(n))` style vectors). Note that the "normal" vector types like `__m128i` etc are builtin types. For those there is getBuiltinVectorTypeInfo() to extract element type and element count.

https://github.com/llvm/llvm-project/pull/140112


More information about the cfe-commits mailing list