[mlir][scf] Add getNumRegionInvocations to IfOp
authorMogball <jeffniu22@gmail.com>
Wed, 15 Dec 2021 06:42:36 +0000 (06:42 +0000)
committerMogball <jeffniu22@gmail.com>
Wed, 15 Dec 2021 14:56:20 +0000 (14:56 +0000)
commitc7103810bde9e300f0a272f0dc55eb324f5415f2
tree36fdbfd5374f03b1243ef796e260fef1aabd0ee9
parent52cb0bbec34fc9320ff8ec1cdd617ea90e56a5e1
[mlir][scf] Add getNumRegionInvocations to IfOp

Implements the RegionBranchOpInterface method getNumRegionInvocations to `scf::IfOp` so that, when the condition is constant, the number of region executions can be analyzed by `NumberOfExecutions`.

Reviewed By: jpienaar, ftynse

Differential Revision: https://reviews.llvm.org/D115087
mlir/include/mlir/Dialect/SCF/SCFOps.td
mlir/lib/Dialect/SCF/SCF.cpp
mlir/unittests/Dialect/CMakeLists.txt
mlir/unittests/Dialect/SCF/CMakeLists.txt [new file with mode: 0644]
mlir/unittests/Dialect/SCF/SCFOps.cpp [new file with mode: 0644]