[mlir][ods] Do not print default-valued attributes when the value is equal to the default
This diff causes the `tblgen`-erated print() function to skip printing a `DefaultValuedAttr` attribute when the value is equal to the default. This feature will reduce the amount of custom printing code that needs to be written by users a relatively common scenario. As a motivating example, for the fastmath flags in the LLVMIR dialect, we would prefer to print this: ``` %0 = llvm.fadd %arg0, %arg1 : f32 ``` instead of this: ``` %0 = llvm.fadd %arg0, %arg1 {fastmathFlags = #llvm.fastmath<none>} : f32 ``` This diff makes the handling of print functionality for default-valued attributes standard. This is an updated version of https://reviews.llvm.org/D135398, without the per-attribute bit to control printing. Reviewed By: Mogball Differential Revision: https://reviews.llvm.org/D135993
Loading
Please sign in to comment