[clang] [CIR][AArch64] Use CIR float types in getSVEType (PR #233896)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 20 23:07:39 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Henrich Lauko (xlauko)
<details>
<summary>Changes</summary>
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.
Assisted-by: Claude Code (Claude Opus 5.5)
---
Full diff: https://github.com/llvm/llvm-project/pull/233896.diff
1 Files Affected:
- (modified) clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp (+2-2)
``````````diff
diff --git a/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp b/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
index 30438d5288608..8cec05be51f93 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);
``````````
</details>
https://github.com/llvm/llvm-project/pull/233896
More information about the cfe-commits
mailing list