[clang] [CIR] Add an explicit mfp8 type (PR #245394)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 23 16:52:53 PST 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions c,cpp,h -- clang/test/CIR/CodeGen/aarch64-mfp8.c clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h clang/lib/CIR/CodeGen/CIRGenBuilder.h clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp clang/lib/CIR/CodeGen/CIRGenModule.cpp clang/lib/CIR/CodeGen/CIRGenTypeCache.h clang/lib/CIR/CodeGen/CIRGenTypes.cpp clang/lib/CIR/Dialect/IR/CIRDialect.cpp clang/lib/CIR/Dialect/IR/CIRTypes.cpp clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp clang/test/CodeGen/AArch64/neon/getset.c clang/test/CodeGen/AArch64/neon/intrinsics.c clang/test/CodeGen/AArch64/neon/load.c clang/test/CodeGen/AArch64/neon/perm.c clang/test/CodeGen/AArch64/neon/store.c --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
index 75714e69b..0a618ba71 100644
--- a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
+++ b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
@@ -1695,8 +1695,8 @@ mlir::LogicalResult cir::VectorType::verify(
if (size.isScalable())
return emitError() << "a scalable vector must have a vector kind";
// A generic mfp8 vector is an AArch64 NEON vector of 64 or 128 bits.
- if (mlir::isa<cir::MFloat8Type>(elementType) &&
- size.getFixedValue() != 8 && size.getFixedValue() != 16)
+ if (mlir::isa<cir::MFloat8Type>(elementType) && size.getFixedValue() != 8 &&
+ size.getFixedValue() != 16)
return emitError() << "a NEON mfp8 vector must have 8 or 16 elements";
return success();
case cir::VectorAbiKind::SVEData: {
@@ -1709,9 +1709,9 @@ mlir::LogicalResult cir::VectorType::verify(
// A scalable mfp8 vector holds one 128-bit granule per vscale. A
// fixed-length one holds a power-of-two number of bits from 128 to 2048.
uint64_t numElts = size.getKnownMinValue();
- if (size.isScalable() ? numElts == 16
- : llvm::isPowerOf2_64(numElts) && numElts >= 16 &&
- numElts <= 256)
+ if (size.isScalable()
+ ? numElts == 16
+ : llvm::isPowerOf2_64(numElts) && numElts >= 16 && numElts <= 256)
return success();
return emitError() << "an SVE mfp8 vector must have [16] elements, or a "
"power-of-two number of elements from 16 to 256";
``````````
</details>
https://github.com/llvm/llvm-project/pull/245394
More information about the cfe-commits
mailing list