SDFG contains unnecessary intermediate transient
- Dominant language
- Python
- Stars
- 593
- Forks
- 163
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 60
Description
**Describe the bug**
SDFG contains unnecessary intermediate transient. Might be an issue with the Python frontend.
**To Reproduce**
Steps to reproduce the behavior:
1. Run the following Python code:
```Python
import dace as dc
@dc.program
def example_sdfg(x: dc.float64[10], y: dc.float64[10]):
x[0] += y[0]
sdfg = example_sdfg.to_sdfg()
sdfg.simplify()
sdfg.view()
```
2. Investigate the produced SDFG (produces SDFG as seen in screenshot).
**Expected behavior**
I expect to get the same SDFG but without the transient `__tmp0` AccessNode and the `y[0]` memlet flowing directly into the tasklet.
**Screenshots**
Screenshot of the produced SDFG:

**Desktop (please complete the following information):**
- OS: Ubuntu 20.04
- DaCe version: 0.14.4 (current main branch)
- Python version: 3.8
Contributor guide
Research direction
Start by running the provided Python example with DaCe 0.14.4 or current main, then inspect the SDFG after example_sdfg.to_sdfg() and sdfg.simplify(). Trace how the transient __tmp0 is produced and compare the resulting memlet flow with the expected direct y[0] connection. Done means the unnecessary AccessNode is absent and y[0] flows directly into the tasklet.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100