Simplify Removes Arrays Used Only For Indirect Accesses
- Dominant language
- Python
- Stars
- 593
- Forks
- 163
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 60
Description
I have a case of simplify failing.
This SDFG computes:
```
@dace.program
def scatter_store(A: dace.float64[N], idx: dace.int64[N], B: dace.float64[N], scale: dace.float64):
for i, in dace.map[0:N:1]:
B[idx[i]] = A[i] * scale
```
Then I have a vectorized variant that does:
```
@dace.program
def scatter_store(A: dace.float64[N], idx: dace.int64[N], B: dace.float64[N], scale: dace.float64):
for i, in dace.map[0:N:8]:
B_buf[0:8] = A[i:i+8] * scale
indices[0:8] = idx[i:i+8]
B[indices[0:8] = B_buf[0:8]
```
In this case `idx` is used only on an interstate edge and it gets removed.
This is the pattern that causes it:
SDFGs are attached:
[scatter_store.sdfg.json](https://github.com/user-attachments/files/24135906/scatter_store.sdfg.json)
[scatter_store_vec.sdfg.json](https://github.com/user-attachments/files/24135909/scatter_store_vec.sdfg.json)
Contributor guide
Assessment
This issue has not been assessed yet.