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

Tobias Gysi llvmlistbot at llvm.org
Sun Dec 3 23:25:13 PST 2023


================
@@ -0,0 +1,9 @@
+// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s
+
+llvm.func @frame_pointer_func() attributes {frame_pointer = #llvm.framePointerKind<"non-leaf">}  {
+  // CHECK-LABEL: define void @frame_pointer_func() 
+  // CHECK-SAME: #[[ATTRS:[0-9]+]]
+  // CHECK: attributes #[[ATTRS]] = { "frame-pointer"="non-leaf" }
+  llvm.return
+}
----------------
gysit wrote:

```suggestion
// CHECK-LABEL: define void @frame_pointer_func() 
// CHECK-SAME: #[[ATTRS:[0-9]+]]
llvm.func @frame_pointer_func() attributes {frame_pointer = #llvm.framePointerKind<"non-leaf">}  {
  llvm.return
}

// CHECK: attributes #[[ATTRS]] = { "frame-pointer"="non-leaf" }
```
nit: similar argument. The attributes are printed after the function IRC. I would thus put the check line for the attribute after the function.

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


More information about the Mlir-commits mailing list