This is an archive of the discontinued LLVM Phabricator instance.

[mlir][cf-sink] Accept a callback for sinking operations
ClosedPublic

Authored by Mogball on Mar 24 2022, 5:33 PM.

Details

Summary

(This was a TODO from the initial patch).

The control-flow sink utility accepts a callback that is used to sink an operation into a region.
The moveIntoRegion is called on the same operation and region that return true for shouldMoveIntoRegion.
The callback must preserve the dominance of the operation within the region. In the default control-flow
sink implementation, this is moving the operation to the start of the entry block.

Diff Detail

Event Timeline

Mogball created this revision.Mar 24 2022, 5:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 5:33 PM
Mogball requested review of this revision.Mar 24 2022, 5:33 PM

Can you figure out a test for this?

Mogball updated this revision to Diff 418322.Mar 25 2022, 2:13 PM

Add a test control-flow sink pass for testing the utilities

mehdi_amini accepted this revision.Mar 25 2022, 2:25 PM
This revision is now accepted and ready to land.Mar 25 2022, 2:25 PM

The failures look real here, missing CMake update?

Yes probably. Let me fix it.

Mogball updated this revision to Diff 418624.Mar 28 2022, 9:45 AM

fix cmake

Mogball updated this revision to Diff 418676.Mar 28 2022, 12:28 PM

rebase (to fix bazel build)

This revision was landed with ongoing or failed builds.Mar 28 2022, 12:31 PM
This revision was automatically updated to reflect the committed changes.