[Mlir-commits] [mlir] [mlir][ROCDL] Remove rocdl.ignore_denormal_mode (PR #231424)

Christian Sigg llvmlistbot at llvm.org
Tue Oct 13 02:34:09 PDT 2026


https://github.com/chsigg created https://github.com/llvm/llvm-project/pull/231424

The `rocdl.ignore_denormal_mode` discardable attribute is superseded by the
`ignore_denormal_mode` unit attribute on `llvm.atomicrmw`, which translates to
the same `!atomic.ignore.denormal.mode` metadata.

>From f0063e54d4429f20feb9a3456a3b8b3fe30f9409 Mon Sep 17 00:00:00 2001
From: Christian Sigg <csigg at google.com>
Date: Mon, 12 Oct 2026 08:32:22 +0200
Subject: [PATCH] [mlir][ROCDL] Remove rocdl.ignore_denormal_mode

The `rocdl.ignore_denormal_mode` discardable attribute is superseded by the
`ignore_denormal_mode` unit attribute on `llvm.atomicrmw`, which translates to
the same `!atomic.ignore.denormal.mode` metadata.
---
 mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.td            | 3 +--
 .../LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp       | 6 ------
 mlir/test/Target/LLVMIR/rocdl.mlir                          | 2 --
 3 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.td b/mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.td
index 5e6cefd977f32..46fad8f55197f 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.td
@@ -169,8 +169,7 @@ def ROCDL_Dialect : Dialect {
      // Correspond to LLVM metadata of the same name
      "::mlir::UnitAttr":$last_use,
      "::mlir::UnitAttr":$no_remote_memory,
-     "::mlir::UnitAttr":$no_fine_grained_memory,
-     "::mlir::UnitAttr":$ignore_denormal_mode
+     "::mlir::UnitAttr":$no_fine_grained_memory
   );
 
   let useDefaultAttributePrinterParser = 1;
diff --git a/mlir/lib/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp
index 895d81dffa27b..ad57551a5ae0e 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp
@@ -257,12 +257,6 @@ class ROCDLDialectLLVMIRTranslationInterface
         i->setMetadata("amdgpu.no.fine.grained.memory",
                        llvm::MDNode::get(llvmContext, {}));
     }
-    if (dialect->getIgnoreDenormalModeAttrHelper().getName() ==
-        attribute.getName()) {
-      for (llvm::Instruction *i : instructions)
-        i->setMetadata(llvm::LLVMContext::MD_atomic_ignore_denormal_mode,
-                       llvm::MDNode::get(llvmContext, {}));
-    }
 
     return success();
   }
diff --git a/mlir/test/Target/LLVMIR/rocdl.mlir b/mlir/test/Target/LLVMIR/rocdl.mlir
index b4a94cef770fa..84d224e0fb8e0 100644
--- a/mlir/test/Target/LLVMIR/rocdl.mlir
+++ b/mlir/test/Target/LLVMIR/rocdl.mlir
@@ -1962,11 +1962,9 @@ llvm.func @rocdl_4_bit_floats(
 llvm.func @rocdl_atomic_attrs(%ptr: !llvm.ptr<1>, %data: f32) {
   // CHECK-LABEL: @rocdl_atomic_attrs
   // CHECK: atomicrmw
-  // CHECK-SAME: !atomic.ignore.denormal.mode
   // CHECK-SAME: !amdgpu.no.fine.grained.memory
   // CHECK-SAME: !amdgpu.no.remote.memory
   llvm.atomicrmw fadd %ptr, %data monotonic {
-    rocdl.ignore_denormal_mode,
     rocdl.no_fine_grained_memory,
     rocdl.no_remote_memory} : !llvm.ptr<1>, f32
   llvm.return



More information about the Mlir-commits mailing list