https://github.com/powdr-labs/powdr/pull/678 adds the Poseidon submachine to the RISCV machine and a bunch of extra registers. This can be quite costly for cases that actually don't use Poseidon at all.
We could have a simple assembly pass that traverses all statements, and if certain instructions are not used, removes them.
When an instruction is removed, if it is delegation, we could potentially also remove the submachine instance (if all its delegations are removed)
We could also remove unused registers after the passes above
This would ensure that the RISCV machine is the same as before when Poseidon is not used
https://github.com/powdr-labs/powdr/pull/678 adds the Poseidon submachine to the RISCV machine and a bunch of extra registers. This can be quite costly for cases that actually don't use Poseidon at all.
This would ensure that the RISCV machine is the same as before when Poseidon is not used