google / google/xls

Priority select over data from receives can be turned into n-ary OR

Open
#607 0 comments 0 reactions 0 assignees View on GitHub
enhancement optimizer
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 10h
Merged PRs (30d)
135

Description

If you have code like

```
if (p) {
y = recv(...);
} else if (q) {
y = recv(...);
} else {
y = recv(...);
}
```

where the channels can be different between the receives, then you can turn the resultant priority select into an OR over the data output of the receives, since when the predicate (propagated from the if-then-else) on each receive is false, the output is all zeros.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.