Skip to content

v0.0.0-6545-g69c1c4510

Compare
Choose a tag to compare
[XLS] Avoid creating cycles when merging channel operations

It is possible for our mutual-exclusion pass to determine that operations are mergeable in such a way that, if all merges are carried out, we will end up creating a cycle. For instance, if we have mergeable classes {A, C} and {B, D}, where D depends on A and C depends on B, we would end up introducing a cyclic dependency.

To avoid this, we check before merging operations whether the result would add a cyclic dependency. If it would, we prevent the merge; if the channels are using `proven_mutually_exclusive` strictness, we produce a more useful error.

Fixes google/xls#1716

PiperOrigin-RevId: 705261047