rust-gpu
rust-gpu copied to clipboard
structurizer: split regions into `Divergent` vs `Convergent`, and optimize based on that.
The first commit is a pretty large refactor that ended up a bit worse than I expected. We might just want to have this instead (and call it in a few places):
impl Region {
fn diverges(&self) -> bool {
self.exits.is_empty()
}
}
The second commit is just an on-the-fly OpPhi simplification that we should probably merge completely separately.
And the third commit is "clever hack" (to remove some unnecessary empty blocks, see example below) that could also probably be done without the first commit, it just didn't hit me that it was possible before the refactor.