GaloisInc / daedalus

The Daedalus data description language
BSD 3-Clause "New" or "Revised" License
66 stars 11 forks source link

Eliminate redundant copies #326

Open yav opened 1 year ago

yav commented 1 year ago

When generating "copy" instructions we sometimes generate redundant copies, which is bad because it can interfere with the "data reuse" optimization (e.g., for builders).

yav commented 1 year ago

I've made some improvements to this for the important cases that arise in many loops. It looks like there is another opportunity for improvement: we can reuse a variable without a copy if the uses are in different case branches