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

Markus Böck llvmlistbot at llvm.org
Tue Nov 14 10:09:57 PST 2023


zero9178 wrote:

> Thanks for the valuable feedback!
> 
> Regarding @zero9178's proposal, it's important to note that this value is an enum, limited to specific values. There are three potential approaches for implementation:
> 
> 1. Use a Separate Enum Type: This is the existing approach. Continue using the enum to ensure only permissible values are used. Implementation across the code is managed through autogenerated functions.
> 2. Dictionary Array Attribute: Can we maintain this with the dictionary array attribute? Could you give an example of an attribute that uses an enumeration but works with the dictionary?
> 3. String Attribute: Would it be more appropriate to define this as a string attribute?

I believe there is a misunderstanding here. I think the use of an enum attribute to model the possible values of frame pointers is perfect :)

What I was suggesting is that the `llvm.func` op parser and printer shouldn't need to have special syntax for handling the frame pointer attribute. If at the call to `function_interface_impl::printFunctionAttributes` you simply don't add the frame pointer attribute name to the list it should be printed as part of the attribute dictionary that all non-specially handled attributes are placed in. 

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


More information about the Mlir-commits mailing list