usubalang / usuba

A programming language to write bitsliced ciphers
https://usubalang.github.io/usuba
MIT License
56 stars 11 forks source link

`remove_dead_code`: reimplement `find_used_variables` #80

Open pedagand opened 2 years ago

pedagand commented 2 years ago

There is a fixpoint computation in module https://github.com/usubalang/usuba/blob/main/src/optimization/remove_dead_code.ml#L31 which out to be a (straightforward?) static analysis.

pedagand commented 2 years ago

Also, why do we add variables in the lhs when one variable on the lhs is used?

If x is used in (x, y) = (42, 54), that doesn't mean that y is used too.