<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/152743>152743</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] `DefaultValuedProp` is printed despite the property being equal
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
amd-eochoalo
</td>
</tr>
</table>
<pre>
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.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVcFu4zgM_RrlQtSwlTiJDz6kkw0mQAczWCxmz7LF2NqRJa9EJ8jfLygnabtAiwEKNBDlRz6-R0rFaDqHWIvyWZT7hZqo96FWg35C3_ZeWb9ovL7WX9FaL-QXEPlO5LsjqAGcJ4hTQDAnoN5E4D9H6DRqaCaCIzRoDZ4RDHHQml9or6Bg9DGaxiI0U5fNiNQjiPL528vxT9C-nQZ0pMh4J8q9kNueaIxiuRPyIORhsCZk1p6HzIdOyIP2bRTysMeTccZ1e6MstsRH30cMCSamLyuIpAgjcLqTt9ZfjOsgYKeC5l9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