Issue |
152743
|
Summary |
[mlir] `DefaultValuedProp` is printed despite the property being equal
|
Labels |
mlir
|
Assignees |
|
Reporter |
amd-eochoalo
|
Hello,
I am not sure if this is intended but I believe it is likely a possible bug.
the [MLIR documentation](https://mlir.llvm.org/docs/DefiningDialects/Operations/) states the following regarding `DefaultValuedAttr`:
> The generated operation printing function will not print default-valued attributes when the attribute value is equal to the default.
I believe the same will apply eventually to `DefaultValuedProp`. However, at the moment that is not the case. The `DefaultValuedProp` will be printed even if the property value is equal to the default one.
While this is likely not a huge issue, it may hinder some adoption of properties. Consider the following case:
1. I want to add a `DefaultValuedAttr` to one of the LLVM intrinsic operations which does not have a custom assembly format (this follows the convention in the LLVMIntrinsicsOp.td file)
2. I believe since `let usePropertiesForAttributes = 1;` then this `DefaultValuedAttr` will be instead stored as a property.
3. This property will now be printed when using `let usePropertiesForAttributes = 0` wouldn't.
4. Then I need to define a custom assembly format where there is no `prop-dict` but instead an `attr-dict` to force the `DefaultValuedAttr` to be kept as an attribute and not a property.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs