This diff adds a bit to the tblgen Attr class that causes the tblgenerated
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
The (in-progress) fastmath support in the arith dialect will use this
feature, as will the LLVMIR dialect. It is expected that other dialects will
also make use of the fastmath attribute, and these dialects can opt-in for the
same behavior. Adding support to tblgen will allow other attributes to
leverage this capability as well.