[llvm] [VFABI] Add support for vector functions that return struct types (PR #119000)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 02:19:38 PST 2024


================
@@ -0,0 +1,30 @@
+//===--- StructWideningUtils.h - Utils for widening/narrowing struct types ===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_IR_STRUCTWIDENINGUTILS_H
+#define LLVM_IR_STRUCTWIDENINGUTILS_H
+
+#include "llvm/IR/DerivedTypes.h"
+
+namespace llvm {
+
+/// A helper for converting structs of scalar types to structs of vector types.
+/// Note: Only unpacked literal struct types are supported.
+Type *ToWideStructTy(StructType *StructTy, ElementCount EC);
+
+/// A helper for converting structs of vector types to structs of scalar types.
+/// Note: Only unpacked literal struct types are supported.
+Type *ToNarrowStructTy(StructType *StructTy);
----------------
fhahn wrote:

```suggestion
Type *toNarrowStructTy(StructType *StructTy);
```

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


More information about the llvm-commits mailing list