[Mlir-commits] [mlir] [MLIR] Add support for frame pointers in MLIR (PR #72145)

Tobias Gysi llvmlistbot at llvm.org
Fri Nov 24 03:30:05 PST 2023


================
@@ -47,6 +47,15 @@ def LinkageAttr : LLVM_Attr<"Linkage", "linkage"> {
   let assemblyFormat = "`<` $linkage `>`";
 }
 
+//===----------------------------------------------------------------------===//
+// FramePointerKindAttr
+//===----------------------------------------------------------------------===//
+
+def FramePointerKindAttr : LLVM_Attr<"FramePointerKind", ""> {
+  let parameters = (ins "framePointerKind::FramePointerKind":$framePointerKind);
+  let assemblyFormat = "$framePointerKind";
----------------
gysit wrote:

The advantage of printing things in the attribute dictionary is that all attributes print the same way: "attribute_name = attribute_value". If it is printed outside, the function to print and parse is implemented by hand and it seems a bit harder to ensure consistency / problems with ordering during parsing etc.

If we want to clearly separate, discardable and inherent attributes we may also print it outside of the dictionary. I that case I would suggest to follow the style of vscale/comdat etc, i.e., `frame_pointer(non-leaf)` or similar

https://github.com/llvm/llvm-project/pull/72145


More information about the Mlir-commits mailing list