[Mlir-commits] [mlir] d578dbf - [mlir][emitc][NFC] Add type clarification to the description for the emitc.global op (#127997)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Feb 21 06:58:58 PST 2025
Author: Andrey Timonin
Date: 2025-02-21T15:58:55+01:00
New Revision: d578dbf9fdb4ce5cba13dda88393c2a67e61a30c
URL: https://github.com/llvm/llvm-project/commit/d578dbf9fdb4ce5cba13dda88393c2a67e61a30c
DIFF: https://github.com/llvm/llvm-project/commit/d578dbf9fdb4ce5cba13dda88393c2a67e61a30c.diff
LOG: [mlir][emitc][NFC] Add type clarification to the description for the emitc.global op (#127997)
Co-authored-by: Marius Brehler <marius.brehler at gmail.com>
Added:
Modified:
mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
index fadee23b25175..196283fe2c7ad 100644
--- a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
+++ b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
@@ -1172,8 +1172,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.
@@ -1193,6 +1193,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 @x : !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