This is an archive of the discontinued LLVM Phabricator instance.

[mlir][SCF] Add `SingleBlock` op trait to "scf.while"
ClosedPublic

Authored by springerm on Aug 30 2023, 6:56 AM.

Details

Summary

This trait is needed so that unstructured control flow is not inlined into "scf.while" ops.

Note: The two regions of "scf.while" are already defined as SizedRegion<1>. SingleBlock can be queried from C++, SizedRegion<n> not.

Fixes #64976.

Diff Detail

Event Timeline

springerm created this revision.Aug 30 2023, 6:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2023, 6:56 AM
springerm requested review of this revision.Aug 30 2023, 6:56 AM
springerm edited the summary of this revision. (Show Details)Aug 30 2023, 6:59 AM
javedabsar accepted this revision.Aug 30 2023, 11:31 AM

LGTM other than the nitpick comment.

mlir/test/Transforms/inlining.mlir
255

Guess the 'func_with_block_args_location' is used here for its 'cf.br' rather than loc part.
Maybe create a new caller with better name for the purpose here?

This revision is now accepted and ready to land.Aug 30 2023, 11:31 AM
springerm marked an inline comment as done.Aug 31 2023, 12:04 AM
This revision was landed with ongoing or failed builds.Aug 31 2023, 12:05 AM
This revision was automatically updated to reflect the committed changes.