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.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Shouldn't we just expect that ifs with known conditions are canonicalized away? I.e., is this ever necessary?
Comment Actions
It depends on how the interface gets used. If used in a speculative fashion, the provided operands are not necessarily the same as the current operands of the if. Some algorithm/analysis could ask "what would be the region invocations if these were the operands". Not entirely sure how much that applies in this situation, but it does for e.g. the branch interfaces (e.g. during constant propagation).
R"mlir( ? (Given we could then, as mentioned in chat, look at injecting some syntax highlighting)