usubalang / usuba

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

`share_var`: turn into proper register allocation #82

Open pedagand opened 2 years ago

pedagand commented 2 years ago

This pass is not an Usuba0 pass: it breaks the invariant that equations are unordered sets by reusing the same variable name multiple times. This may be justified, as a for of register allocation, when going to C but that shouldn't be there.

Look into SSA-to-asm for inspiration.

pedagand commented 2 years ago

In fact, @DadaIsCrazy points out that this pass is disabled by default

https://github.com/usubalang/usuba/blob/ec7ec9c339feb403133ac3bc6455d3639994b97a/bin/cli/main.ml#L120

and I don't think any code actually uses it. We can safely remove it. @mattiasdrp: I let you take over this one.