[mlir] Add a ControlFlowSink pass.
authorMogball <jeffniu22@gmail.com>
Mon, 24 Jan 2022 23:00:39 +0000 (23:00 +0000)
committerMogball <jeffniu22@gmail.com>
Mon, 24 Jan 2022 23:08:34 +0000 (23:08 +0000)
commit572fa9642cb50f3c2d79e138e789c4b23f3ab8cf
tree41406ab09ad3521c3cea1465063962df258d181e
parentf1c9e7bdc921cec0cc3f61c19c4ac4a7f1bd8525
[mlir] Add a ControlFlowSink pass.

Control-Flow Sink moves operations whose only uses are in conditionally-executed regions into those regions so that paths in which their results are not needed do not perform unnecessary computation.

Depends on D115087

Reviewed By: jpienaar, rriddle, bondhugula

Differential Revision: https://reviews.llvm.org/D115088
12 files changed:
mlir/include/mlir/Interfaces/ControlFlowInterfaces.h
mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
mlir/include/mlir/Transforms/Passes.h
mlir/include/mlir/Transforms/Passes.td
mlir/include/mlir/Transforms/Utils.h
mlir/lib/Transforms/CMakeLists.txt
mlir/lib/Transforms/ControlFlowSink.cpp [new file with mode: 0644]
mlir/lib/Transforms/Utils/CMakeLists.txt
mlir/lib/Transforms/Utils/ControlFlowSinkUtils.cpp [new file with mode: 0644]
mlir/test/Transforms/control-flow-sink.mlir [new file with mode: 0644]
mlir/test/lib/Dialect/Test/TestDialect.cpp
mlir/test/lib/Dialect/Test/TestOps.td