This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Expand default arg builders to wrapped attributes.
ClosedPublic

Authored by jpienaar on Dec 27 2022, 12:22 PM.

Details

Summary

Previously only unwrapped values were considered for default values in
builders, expand to Attributes given the change to populate defaults. To avoid
overlap between wrapped and unwrapped, the starting index is incremented
depending on if the smallest starting index for default valued args can be
materialized in unwrapped form or not.

Given the above limitation this is pretty small change.

optional is unfortunately meant to also represent conditionally set which
means we cannot allow nullptr for all Attributes marked optional at the moment.

Diff Detail

Event Timeline

jpienaar created this revision.Dec 27 2022, 12:22 PM
jpienaar requested review of this revision.Dec 27 2022, 12:22 PM
Mogball accepted this revision.Jan 3 2023, 8:21 AM

nice

mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
2063

can you inline this variable?

2081

does this work?

2086

please drop trivial braces

2139

please drop trivial braces (I know they were already here)

This revision is now accepted and ready to land.Jan 3 2023, 8:21 AM
jpienaar updated this revision to Diff 486033.Jan 3 2023, 11:06 AM
jpienaar marked 3 inline comments as done.

Address comments and rebase

Couple of more custom builders got added that overlap that needs to be addressed first.

This revision was landed with ongoing or failed builds.Nov 3 2023, 3:30 PM
This revision was automatically updated to reflect the committed changes.