[clang] [CIR][AArch64] Use CIR float types in getSVEType (PR #233896)
Henrich Lauko via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 20 23:04:57 PDT 2026
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/233896
>From 82e4bec21cf7f99ba39f774a22975f121e922ba4 Mon Sep 17 00:00:00 2001
From: Henrich Lauko <hlauko at nvidia.com>
Date: Tue, 20 Oct 2026 09:44:00 +0000
Subject: [PATCH] [CIR][AArch64] Use CIR float types in getSVEType
getSVEType built the bf16 and f32 vectors from mlir::Builder's
getBF16Type() and getF32Type(), which return builtin MLIR types.
!cir.vector only accepts CIR element types, so an assertions build
aborts in VectorType::get and a release build creates an invalid type.
Use getBfloat16Ty() and getSingleTy(), as the f16 and f64 cases do.
No test: the only caller, svdup_n_b*, reaches only the predicate cases.
Assisted-by: Claude Code (Claude Opus 5.5)
---
clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp b/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
index 30438d5288608a..8cec05be51f931 100644
--- a/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
@@ -1598,9 +1598,9 @@ cir::VectorType CIRGenFunction::getSVEType(const SVETypeFlags &typeFlags) {
case SVETypeFlags::EltTyFloat16:
return cir::VectorType::get(builder.getFp16Ty(), 8, true);
case SVETypeFlags::EltTyBFloat16:
- return cir::VectorType::get(builder.getBF16Type(), 8, true);
+ return cir::VectorType::get(builder.getBfloat16Ty(), 8, true);
case SVETypeFlags::EltTyFloat32:
- return cir::VectorType::get(builder.getF32Type(), 4, true);
+ return cir::VectorType::get(builder.getSingleTy(), 4, true);
case SVETypeFlags::EltTyFloat64:
return cir::VectorType::get(builder.getDoubleTy(), 2, true);
More information about the cfe-commits
mailing list