quil-lang / quilc

The optimizing Quil compiler.
Apache License 2.0
452 stars 73 forks source link

Deduplicate code in logical-schedule #837

Closed markasoftware closed 2 years ago

markasoftware commented 2 years ago

Noticed that a couple functions were suspiciously similar. Adding commuting blocks to the schedule is not all that different than adding any other kind of instruction; just delay adding the new threads to the top and bottom of the lschedule until after all the threads have been added.

One question: Why are COMMUTING_BLOCKs that use the +IMPOSSIBLY-FULL-RESOURCE+ disallowed? I didn't notice anything in logical-scheduler.lisp that would fail.

ecpeterson commented 2 years ago

Oh I didn't see that you'd retracted the PR this morning. I'll ask why on Thursday.

markasoftware commented 2 years ago

I thought I could make further simplifications related to commuting_blocks but they didn't work out. I'll undraftify the PR