Skip to content

[Codegen] Fix dominance issue in collapse shape fusion - #20864

Merged
jtuyls merged 1 commit into
iree-org:mainfrom
jtuyls:fix-fuse-and-hoist-forall
May 20, 2025
Merged

jtuyls merged 1 commit into
iree-org:mainfrom
jtuyls:fix-fuse-and-hoist-forall

Conversation

@jtuyls

@jtuyls jtuyls commented May 20, 2025

Copy link
Copy Markdown
Contributor

In fusion of consumer tensor.collapse_shape operations into scf.forall, there is a potential dominance issue if the tensor.parallel_insert_slice operation depends on both a BlockArgument and an affine expression on the same BlockArgument (in this order). This lead to the following error for the added test:

...
error: operand #1 does not dominate this use
    %2 = affine.apply #map(%arg4)
...

@jtuyls
jtuyls force-pushed the fix-fuse-and-hoist-forall branch from 8934463 to 7703f61 Compare May 20, 2025 13:41
@jtuyls
jtuyls requested review from Max191, hanhanW and qedawkins and removed request for MaheshRavishankar, antiagainst and qedawkins May 20, 2025 13:42
@jtuyls
jtuyls merged commit bc0da66 into iree-org:main May 20, 2025
@jtuyls
jtuyls deleted the fix-fuse-and-hoist-forall branch May 20, 2025 15:00
ziereis pushed a commit to ziereis/iree that referenced this pull request May 22, 2025
In fusion of consumer `tensor.collapse_shape` operations into
`scf.forall`, there is a potential dominance issue if the
`tensor.parallel_insert_slice` operation depends on both a BlockArgument
and an affine expression on the same BlockArgument (in this order). This
lead to the following error for the added test:
```
...
error: operand #1 does not dominate this use
    %2 = affine.apply #map(%arg4)
...
```

Signed-off-by: Jorn Tuyls <[email protected]>
Signed-off-by: Thomas Ziereis <[email protected]>
AWoloszyn pushed a commit that referenced this pull request Dec 1, 2025
In fusion of consumer `tensor.collapse_shape` operations into
`scf.forall`, there is a potential dominance issue if the
`tensor.parallel_insert_slice` operation depends on both a BlockArgument
and an affine expression on the same BlockArgument (in this order). This
lead to the following error for the added test:
```
...
error: operand #1 does not dominate this use
    %2 = affine.apply #map(%arg4)
...
```

Signed-off-by: Jorn Tuyls <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants