This is an archive of the discontinued LLVM Phabricator instance.

[mlir][IR] SingleBlockImplicitTerminator: Declare "inherited" trait in ODS instead of C++
ClosedPublic

Authored by springerm on Aug 29 2023, 3:00 AM.

Details

Summary

SingleBlockImplicitTerminator is now a combination of two traits: SingleBlock and SingleBlockImplicitTerminatorImpl (the original SingleBlockImplicitTerminator).

This change makes it possible to check if the SingleBlock op trait is implemented. Until now, Operation::hasTrait<OpTrait::SingleBlock>() returned false for ops that implement SingleBlockImplicitTerminator.

Discussion: https://discourse.llvm.org/t/optrait-inheritance-should-be-discouraged/73100

Diff Detail

Event Timeline

springerm created this revision.Aug 29 2023, 3:00 AM
Herald added a reviewer: rriddle. · View Herald Transcript
Herald added a reviewer: aartbik. · View Herald Transcript
Herald added a reviewer: jpienaar. · View Herald Transcript
Herald added a reviewer: ftynse. · View Herald Transcript
Herald added a reviewer: aartbik. · View Herald Transcript
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a reviewer: kuhar. · View Herald Transcript
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
springerm requested review of this revision.Aug 29 2023, 3:00 AM
springerm edited the summary of this revision. (Show Details)Aug 29 2023, 3:01 AM
springerm updated this revision to Diff 554290.Aug 29 2023, 6:18 AM
springerm edited the summary of this revision. (Show Details)

address comments from Discourse

springerm retitled this revision from [mli][IR][WIP] Do not use op trait inheritance for SingleBlockImplicitTerminator to [mlir][IR] SingleBlockImplicitTerminator: Declare "inherited" trait in ODS instead of C++.Aug 29 2023, 6:19 AM
springerm edited the summary of this revision. (Show Details)
springerm added a reviewer: mehdi_amini.
zero9178 accepted this revision.Aug 30 2023, 1:34 AM

CI seems to complain that OpDefinition.h is not properly clang-formatted which should probably be fixed (line 945 if I had to guess).

Otherwise LGTM.

jpienaar accepted this revision.Aug 30 2023, 5:13 AM

Nice, thanks

This revision is now accepted and ready to land.Aug 30 2023, 5:13 AM
This revision was landed with ongoing or failed builds.Aug 30 2023, 6:27 AM
This revision was automatically updated to reflect the committed changes.