[Mlir-commits] [mlir] [NFC][mlir][gpu] Make syn_name an intrinsic attr in GPUModuleOp (PR #94918)
Fabian Mora
llvmlistbot at llvm.org
Sun Jun 9 14:41:43 PDT 2024
https://github.com/fabianmcg created https://github.com/llvm/llvm-project/pull/94918
None
>From 3bb33d81678e5ef7fd7cc5f69acae36d1d2ff7cc Mon Sep 17 00:00:00 2001
From: Fabian Mora <fmora.dev at gmail.com>
Date: Sun, 9 Jun 2024 21:41:11 +0000
Subject: [PATCH] [NFC][mlir][gpu] Make syn_name an intrinsic attr in
GPUModuleOp
---
mlir/include/mlir/Dialect/GPU/IR/GPUOps.td | 2 +-
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/mlir/include/mlir/Dialect/GPU/IR/GPUOps.td b/mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
index 10719aae5c8b4..eb81b6469746f 100644
--- a/mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
+++ b/mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
@@ -1241,7 +1241,7 @@ def GPU_BarrierOp : GPU_Op<"barrier"> {
def GPU_GPUModuleOp : GPU_Op<"module", [
DataLayoutOpInterface, HasDefaultDLTIDataLayout, IsolatedFromAbove,
SymbolTable, Symbol, SingleBlockImplicitTerminator<"ModuleEndOp">
- ]>, Arguments<(ins
+ ]>, Arguments<(ins SymbolNameAttr:$sym_name,
OptionalAttr<GPUNonEmptyTargetArrayAttr>:$targets,
OptionalAttr<OffloadingTranslationAttr>:$offloadingHandler)> {
let summary = "A top level compilation unit containing code to be run on a GPU.";
diff --git a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
index 0c2590d711301..d40c586a313b0 100644
--- a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
+++ b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
@@ -1730,12 +1730,11 @@ void GPUModuleOp::build(OpBuilder &builder, OperationState &result,
StringRef name, ArrayAttr targets,
Attribute offloadingHandler) {
ensureTerminator(*result.addRegion(), builder, result.location);
- result.attributes.push_back(builder.getNamedAttr(
- ::mlir::SymbolTable::getSymbolAttrName(), builder.getStringAttr(name)));
Properties &props = result.getOrAddProperties<Properties>();
if (targets)
props.targets = targets;
+ props.setSymName(builder.getStringAttr(name));
props.offloadingHandler = offloadingHandler;
}
More information about the Mlir-commits
mailing list