... cond_br %cond, ^bb1(...), ^bb2(...) ... ^bb1: // has single predecessor ... cond_br %cond, ^bb3(...), ^bb4(...)
->
... cond_br %cond, ^bb1(...), ^bb2(...) ... ^bb1: // has single predecessor ... br ^bb3(...)
Paths
| Differential D89604
[mlir] Add canonicalization for cond_br that feed into a cond_br on the same condition ClosedPublic Authored by rriddle on Oct 16 2020, 5:00 PM.
Details Summary ... cond_br %cond, ^bb1(...), ^bb2(...) ... ^bb1: // has single predecessor ... cond_br %cond, ^bb3(...), ^bb4(...) -> ... cond_br %cond, ^bb1(...), ^bb2(...) ... ^bb1: // has single predecessor ... br ^bb3(...)
Diff Detail
Event TimelineHerald added subscribers: stephenneuendorffer, nicolasvasilache. · View Herald TranscriptOct 16 2020, 5:00 PM Comment Actions Nice, micro nit: in description add ... as when I initially read it I thought there was requirement for empty block bb1 This revision is now accepted and ready to land.Oct 16 2020, 7:35 PM bondhugula added inline comments. This revision was landed with ongoing or failed builds.Oct 18 2020, 1:56 PM Closed by commit rGa8feeee15fea: [mlir] Add canonicalization for cond_br that feed into a cond_br on the same… (authored by rriddle). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 298902 mlir/lib/Dialect/StandardOps/IR/Ops.cpp
mlir/test/Dialect/Standard/canonicalize-cf.mlir
mlir/test/Transforms/canonicalize-block-merge.mlir
|
Consider adding a line on the simplification - the example below doesn't capture the fact that ^bb1 has only one predessor.