Fix correctness of InvarianceCheck and other SSA slice walks. - #61
Draft
KFAFSP wants to merge 1 commit into
Draft
Conversation
Provides a backport of llvm-project/pull/188758 which is used to implement generic SSA slice analyses. In particular, provides a cached control-flow aware `BackwardSliceAnalysis`, the `ForwardSlice` helper and the `LoopSliceAnalysis`. The `LoopSliceAnalysis` uses the `mlir::LoopLikeOpInterface` to determine all fundamental loop-variant SSA values and constructs a forward slice from them. This analysis is intended to replace the crude invariance check currently used in the scheduler. Signed-off-by: Karl F. A. Friebel <karl.friebel@ibm.com>
KFAFSP
force-pushed
the
kfaf/ssa-dependence-analysis
branch
from
August 6, 2026 15:48
76a6108 to
ebf4ac4
Compare
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.
This is a continuation of the pre-open-source issue with the following description:
The previous implementation of the InvarianceCheck did not properly examine the required MLIR interfaces, and did not consider dependencies carried through block arguments. In particular, it was not conservative enough. This can be done using built-in functionality provided in mlir/Analysis/SliceWalk.h.
This commit adds a new SliceAnalysis and LoopSliceAnalysis types that implement the correct behavior and a reusable cache as a managed MLIR analysis.
Unfortunately, there is a bug upstream that prevents the aforementioned MLIR utility from working correctly. Until the associated PR is merged in, the new SliceAnalysis is overly conservative.
There are now more uses for these analyses in the scheduler, and therefore we should hurry to centralize this key feature of IR analysis.