Skip to content

Simplify Removes Arrays Used Only For Indirect Accesses #2254

@ThrudPrimrose

Description

@ThrudPrimrose

I have a case of simplify failing.

This SDFG computes:

Image
@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:
Image

SDFGs are attached:
scatter_store.sdfg.json

scatter_store_vec.sdfg.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions