[Mlir-commits] [mlir] [mlir][ABI] Fix scalable vector mapping in ABITypeMapper (PR #206617)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Tue Jun 30 08:32:00 PDT 2026
================
@@ -170,4 +170,34 @@ TEST_F(ABITypeMapperTest, MapUnsignedI32) {
EXPECT_FALSE(intTy->isSigned());
}
+TEST_F(ABITypeMapperTest, MapScalableVectorOf4xF32) {
+ DataLayout dl(module);
+ ABITypeMapper mapper(dl);
+
+ auto f32 = Float32Type::get(&ctx);
+ auto vec = VectorType::get({4}, f32, /* scalableDims=*/true);
+ const llvm::abi::Type *result = mapper.map(vec);
+
+ ASSERT_NE(result, nullptr);
+ EXPECT_TRUE(result->isVector());
+
+ auto *vecTy = llvm::cast<llvm::abi::VectorType>(result);
+ EXPECT_TRUE(vecTy->getNumElements().isScalable());
+ EXPECT_EQ(vecTy->getNumElements().getKnownMinValue(), 4u);
+ EXPECT_TRUE(vecTy->getElementType()->isFloat());
+}
+
+TEST_F(ABITypeMapperTest, MapMultiScalableVectorReturnsNull) {
----------------
banach-space wrote:
```suggestion
TEST_F(ABITypeMapperTest, MapWithTwoScalableDimsReturnsNull) {
```
https://github.com/llvm/llvm-project/pull/206617
More information about the Mlir-commits
mailing list