Repository navigation
[Codegen] Fix dominance issues blocking consumer fusions - #21551
Merged
Max191 merged 2 commits intoAug 1, 2025
Merged
Conversation
Signed-off-by: Max Dawkins <[email protected]>
Collaborator
|
Ok, this has been one of the things that I wanted to fix upstream (which has gotten more complicated than it needs to be). This is OK for now, but I'll fix it next week. |
Signed-off-by: Max Dawkins <[email protected]>
Max191
force-pushed
the
consumer-fusion-pattern-dominance-fix
branch
from
July 31, 2025 18:57
40a0d86 to
bdcafdf
Compare
hanhanW
approved these changes
Jul 31, 2025
hanhanW
added a commit
to hanhanW/iree
that referenced
this pull request
Aug 8, 2025
…e-org#21551)" This reverts commit 9c77258.
hhkit
pushed a commit
to opencompl/iree
that referenced
this pull request
Aug 8, 2025
) The consumer fusion utility upstream does not allow fusing consumers when the producer loop has any users that are dominated by the consumer to fuse, even if the other user comes from a different result of the loop. This seems to be a result of the way the transformation is implemented, and it would be a non-trivial refactor to support the case in upstream MLIR. Instead, this PR supports the case by moving the consumer (and any ops needed to obey dominance) to right after the loop before fusing. --------- Signed-off-by: Max Dawkins <[email protected]>
Max191
added a commit
to Max191-agents/iree
that referenced
this pull request
Aug 8, 2025
…e-org#21551)" This reverts commit 9c77258.
Max191
added a commit
to Max191-agents/iree
that referenced
this pull request
Aug 8, 2025
…e-org#21551)" This reverts commit 9c77258. Signed-off-by: Max Dawkins <[email protected]>
Max191
added a commit
that referenced
this pull request
Aug 8, 2025
…1551)" (#21637) Reapplies 9c77258 with a bug fix for #21622. Operations were being moved by the rewriter before the FuseTilableConsumer pattern was guaranteed to succeed, which added the ops to the pattern worklist every time the pattern failed. This caused an infinite recursion of the pattern application. The fix is to move the ops without the rewriter, so they will not be added to the worklist. This op movement can also be removed once the upstream fusion transformation is refactored to properly handle multi-result scf.forall loops. --------- Signed-off-by: Max Dawkins <[email protected]>
hhkit
pushed a commit
to opencompl/iree
that referenced
this pull request
Aug 11, 2025
…ee-org#21551)" (iree-org#21637) Reapplies iree-org@9c77258 with a bug fix for iree-org#21622. Operations were being moved by the rewriter before the FuseTilableConsumer pattern was guaranteed to succeed, which added the ops to the pattern worklist every time the pattern failed. This caused an infinite recursion of the pattern application. The fix is to move the ops without the rewriter, so they will not be added to the worklist. This op movement can also be removed once the upstream fusion transformation is refactored to properly handle multi-result scf.forall loops. --------- Signed-off-by: Max Dawkins <[email protected]>
AWoloszyn
pushed a commit
that referenced
this pull request
Dec 1, 2025
The consumer fusion utility upstream does not allow fusing consumers when the producer loop has any users that are dominated by the consumer to fuse, even if the other user comes from a different result of the loop. This seems to be a result of the way the transformation is implemented, and it would be a non-trivial refactor to support the case in upstream MLIR. Instead, this PR supports the case by moving the consumer (and any ops needed to obey dominance) to right after the loop before fusing. --------- Signed-off-by: Max Dawkins <[email protected]>
AWoloszyn
pushed a commit
that referenced
this pull request
Dec 1, 2025
…1551)" (#21637) Reapplies 9c77258 with a bug fix for #21622. Operations were being moved by the rewriter before the FuseTilableConsumer pattern was guaranteed to succeed, which added the ops to the pattern worklist every time the pattern failed. This caused an infinite recursion of the pattern application. The fix is to move the ops without the rewriter, so they will not be added to the worklist. This op movement can also be removed once the upstream fusion transformation is refactored to properly handle multi-result scf.forall loops. --------- Signed-off-by: Max Dawkins <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The consumer fusion utility upstream does not allow fusing consumers when the producer loop has any users that are dominated by the consumer to fuse, even if the other user comes from a different result of the loop. This seems to be a result of the way the transformation is implemented, and it would be a non-trivial refactor to support the case in upstream MLIR. Instead, this PR supports the case by moving the consumer (and any ops needed to obey dominance) to right after the loop before fusing.