dace
dace copied to clipboard
Lift trivial Ifs
Dead control flow elimination does not simplify by trying to evaluate trivial if conditions. I wrote a pass that does that:
It tries to eval if branches that are trivially true and then lifts the inner CFG upwards:
Becomes:
It supports branches of type:
if (cond)
and (empty else):
if(cond)
...
else:
....
Example:
Becomes:
Pinging @tbennun for re-review about the mentioned minor change