[pull] master from phate:master#628
Merged
pull[bot] merged 1 commit intoEECS-NTNU:masterfrom Feb 10, 2026
Merged
Conversation
This PR extends the ScalarEvolution implementation by adding support for computing recurrences for `GetElementPtr` operations. It does this by adding a few new cases to the `GetOrCreateSCEVForOutput()` method, particularly for `GetElementPtr`, `Load`, `IOBarrier` and `SExt` operations. The SCEV for the GetElementPtr operation is computed recursively to support an arbitrary number of indexes, and supports both _array_ and _struct_ GEPs. This PR also adds two simple tests for the two types of GEPs. Since the value of a GEP is not directly tied to the update of an induction variable (passes through a _load_ from memory), some changes were needed in the way recurrences are computed. Particularly, we now compute recurrences for all _valid_ SCEVs as opposed to computing the recurrences for just the loop variables. By valid we mean that the dependencies for the RVSDG output the SCEV corresponds to passes the three requirements. These being: - No more than one self-dependency in the dependency graph (indicates a self-dependent variable) - No cyclic dependencies (A depends on B and B depends on A) - No dependencies via multiplication (results in a geometric update sequence, which we treat as an invalid induction variable) This change means that we end up with a larger amount of chain recurrences at the end of the analysis, some of which can be seen as "junk" or "noise". For the analysis itself this makes no difference, however for measuring the results, we should probably filter most of these out.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )