[Mlir-commits] [mlir] [mlir][emitc] Use LLVM_FALLTHROUGH (NFC) (PR #152464)
Andrey Timonin
llvmlistbot at llvm.org
Thu Aug 7 08:13:28 PDT 2025
https://github.com/EtoAndruwa updated https://github.com/llvm/llvm-project/pull/152464
>From a00761f6b06ee98bd9f4f2825e5553884b90c5bd Mon Sep 17 00:00:00 2001
From: EtoAndruwa <timonina1909 at gmail.com>
Date: Thu, 7 Aug 2025 12:14:32 +0300
Subject: [PATCH] [mlir][emitc] Simplify emitc::isSupportedFloatType
---
mlir/lib/Dialect/EmitC/IR/EmitC.cpp | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/mlir/lib/Dialect/EmitC/IR/EmitC.cpp b/mlir/lib/Dialect/EmitC/IR/EmitC.cpp
index e6a3154721faa..0b4ca67e92ecf 100644
--- a/mlir/lib/Dialect/EmitC/IR/EmitC.cpp
+++ b/mlir/lib/Dialect/EmitC/IR/EmitC.cpp
@@ -17,6 +17,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
using namespace mlir;
using namespace mlir::emitc;
@@ -114,11 +115,8 @@ bool mlir::emitc::isIntegerIndexOrOpaqueType(Type type) {
bool mlir::emitc::isSupportedFloatType(Type type) {
if (auto floatType = llvm::dyn_cast<FloatType>(type)) {
switch (floatType.getWidth()) {
- case 16: {
- if (llvm::isa<Float16Type, BFloat16Type>(type))
- return true;
- return false;
- }
+ case 16:
+ return llvm::isa<Float16Type, BFloat16Type>(type);
case 32:
case 64:
return true;
More information about the Mlir-commits
mailing list