[Mlir-commits] [mlir] [mlir][arith] Fix variable only used by assert (PR #188461)

Yi Zhang llvmlistbot at llvm.org
Wed Mar 25 04:24:48 PDT 2026


https://github.com/cathyzhyi created https://github.com/llvm/llvm-project/pull/188461

None

>From 390c83901ff8c18830881edd93788dcfb9945b17 Mon Sep 17 00:00:00 2001
From: Yi Zhang <cathyzhyi at google.com>
Date: Wed, 25 Mar 2026 07:10:44 -0400
Subject: [PATCH] [mlir][arith] Fix variable only used by assert

---
 mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp b/mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp
index a0346ec6f4fb6..d9ab2cd5cabe7 100644
--- a/mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp
+++ b/mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp
@@ -279,11 +279,12 @@ struct ConvertFOpLowering : public ConvertOpToLLVMPattern<arith::ConvertFOp> {
 
     // Only bf16 <-> f16 conversions are supported. There is currently no other
     // pair of FP types that are valid LLVM types.
-    auto srcType = getElementTypeOrSelf(op.getIn().getType());
-    auto dstType = getElementTypeOrSelf(op.getType());
+    [[maybe_unused]] auto srcType = getElementTypeOrSelf(op.getIn().getType());
+    [[maybe_unused]] auto dstType = getElementTypeOrSelf(op.getType());
     assert((srcType.isBF16() && dstType.isF16()) ||
            (srcType.isF16() && dstType.isBF16()) &&
                "only bf16 <-> f16 conversions are supported");
+    llvm::
 
     Type convertedType = getTypeConverter()->convertType(op.getType());
     if (!convertedType)



More information about the Mlir-commits mailing list