[Mlir-commits] [mlir] [mlir][emitc][NFC] Add type clarification to the description for the emitc.global op (PR #127997)
Andrey Timonin
llvmlistbot at llvm.org
Thu Feb 20 04:16:58 PST 2025
https://github.com/EtoAndruwa created https://github.com/llvm/llvm-project/pull/127997
None
>From e97953575814bcdbba5fa34e70a22690e4a5c4b6 Mon Sep 17 00:00:00 2001
From: EtoAndruwa <timonina1909 at gmail.com>
Date: Thu, 20 Feb 2025 15:13:12 +0300
Subject: [PATCH] [mlir][emitc][NFC] Add type clarification to the description
for the emitc.global operation
---
mlir/include/mlir/Dialect/EmitC/IR/EmitC.td | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
index 4fbce995ce5b8..e7a76e808e6c6 100644
--- a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
+++ b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
@@ -1126,8 +1126,8 @@ def EmitC_GlobalOp : EmitC_Op<"global", [Symbol]> {
let summary = "A global variable";
let description = [{
The `emitc.global` operation declares or defines a named global variable.
- The backing memory for the variable is allocated statically and is
- described by the type of the variable.
+ The backing memory for the variable is allocated statically and described by
+ the variable's type, which must be an EmitC type.
Optionally, an `initial_value` can be provided.
Internal linkage can be specified using the `static_specifier` unit attribute
and external linkage can be specified using the `extern_specifier` unit attribute.
@@ -1147,6 +1147,8 @@ def EmitC_GlobalOp : EmitC_Op<"global", [Symbol]> {
emitc.global @x : !emitc.array<2xf32> = dense<0.0>
// Global variable with an initial values.
emitc.global @x : !emitc.array<3xi32> = dense<[0, 1, 2]>
+ // Global variable with an opaque initial value.
+ emitc.global @y : !emitc.opaque<"char"> = #emitc.opaque<"CHAR_MIN">
// External global variable
emitc.global extern @x : !emitc.array<2xf32>
// Constant global variable with internal linkage
More information about the Mlir-commits
mailing list