Overlapping select CSE pass
Open
optimizer
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
Suppose we have code like
```
foo: bits[32] = sel(selector, cases=[w, x, y, z])
bar: bits[32] = sel(selector, cases=[w, x], default=zero)
```
then we could overlap the computation of the substrings of cases by converting to
```
bar: bits[32] = sel(selector, cases=[w, x], default=zero)
foo: bits[32] = (selector < 2) ? bar : sel(selector - 2, cases=[y, z])
```
Maybe a shortest common superstring algorithm would work well here?
Contributor guide
Assessment
This issue has not been assessed yet.