dace icon indicating copy to clipboard operation
dace copied to clipboard

Lift trivial Ifs

Open ThrudPrimrose opened this issue 3 months ago • 1 comments

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: image Becomes: image

It supports branches of type:

if (cond)

and (empty else):

if(cond) 
...
else:
....

Example: image Becomes: image

ThrudPrimrose avatar Sep 04 '25 11:09 ThrudPrimrose

Pinging @tbennun for re-review about the mentioned minor change

phschaad avatar Nov 04 '25 07:11 phschaad