This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Do not print default-valued attributes in generic format.
AbandonedPublic

Authored by vzakhari on Oct 18 2022, 7:11 PM.

Details

Summary

Do not print default-valued attributes that have default values
in generic operation printer. This is a follow-up on D135993.

This change is needed to avoid printing default fastmathFlags
for LLVM dialect intrinsics operations, when they start supporting
the flags.

Diff Detail

Event Timeline

vzakhari created this revision.Oct 18 2022, 7:11 PM
Herald added a reviewer: ftynse. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
vzakhari requested review of this revision.Oct 18 2022, 7:11 PM
Herald added a project: Restricted Project. · View Herald Transcript
rriddle requested changes to this revision.Oct 18 2022, 7:23 PM

I'm not 100% convinced this is a good idea. We generally don't elide information from generic formats, and I don't think we should start. This makes it much harder to actually see the structure of the op, and I'd rather leave elision up to the custom formats.

This revision now requires changes to proceed.Oct 18 2022, 7:23 PM

I'm not 100% convinced this is a good idea. We generally don't elide information from generic formats, and I don't think we should start. This makes it much harder to actually see the structure of the op, and I'd rather leave elision up to the custom formats.

Sounds reasonable. I will deal with LLVM intrinsics printout in a different way. Thank you for the prompt reply!

I'm not 100% convinced this is a good idea. We generally don't elide information from generic formats, and I don't think we should start. This makes it much harder to actually see the structure of the op, and I'd rather leave elision up to the custom formats.

Sounds reasonable. I will deal with LLVM intrinsics printout in a different way. Thank you for the prompt reply!

Have we considered just adding custom formats for those? There is also a way to add custom format fallbacks via the dialect: https://github.com/llvm/llvm-project/blob/28d70d3f1e2ad2497c90ce024548f7f211feb72f/mlir/include/mlir/IR/Dialect.h#L118

Have we considered just adding custom formats for those?

Yes, this is what I am going to do.

There is also a way to add custom format fallbacks via the dialect: https://github.com/llvm/llvm-project/blob/28d70d3f1e2ad2497c90ce024548f7f211feb72f/mlir/include/mlir/IR/Dialect.h#L118

Thanks! This is an option.

vzakhari abandoned this revision.Oct 18 2022, 9:35 PM