You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CIR][Lowering] add cir.ternary to scf.if lowering (#368)
This PR adds `cir.ternary` lowering. There are two approaches to lower
`cir.ternary` imo:
1. Use `scf.if` op.
2. Use `cf.cond_br` op.
I choose `scf.if` because `scf.if` + canonicalization produces
`arith.select` whereas `cf.cond_br` requires scf lifting. In many ways
`scf.if` is more high-level and closer to `cir.ternary`.
A separate `cir.yield` lowering is required since we cannot directly
replace `cir.yield` in the ternary op lowering -- the yield operands may
still be illegal and doing so produces `builtin.unrealized_cast` ops. I
couldn't figured out a way to solve this issue without adding a separate
lowering pattern. Please let me know if you know a way to solve this
issue.
0 commit comments