[AIE] Consolidate itinerary queries over register supersets#999
Open
martien-de-jong wants to merge 1 commit into
Open
[AIE] Consolidate itinerary queries over register supersets#999martien-de-jong wants to merge 1 commit into
martien-de-jong wants to merge 1 commit into
Conversation
| StringRef TimingModelName; | ||
|
|
||
| bool operator==(const StageCycleInfo &Other) const { | ||
| return Cycles == Other.Cycles && UnitNames == Other.UnitNames && |
Collaborator
There was a problem hiding this comment.
nit: check cheaper first, also, could we have early returns? Cycles -> TimingModelName -> UnitNames? Maybe we can save some table build time.
| bool operator<(const StageCycleInfo &Other) const { | ||
| if (Cycles != Other.Cycles) | ||
| return Cycles < Other.Cycles; | ||
| if (UnitNames != Other.UnitNames) |
Collaborator
There was a problem hiding this comment.
This could be the last test.
| /// \param ItinName The name of the itinerary to look up. | ||
| /// \returns The signature for the itinerary. If not found, returns an empty | ||
| /// signature. | ||
| ItinerarySignature getSignature(StringRef ItinName) const { |
Collaborator
Author
There was a problem hiding this comment.
Actually, unused function...
|
|
||
| // First check that all input classes have compatible attributes. | ||
| for (size_t I = 1; I < RCs.size(); ++I) { | ||
| if (!haveCompatibleAttributes(*RCs[0], *RCs[I])) { |
Collaborator
There was a problem hiding this comment.
Check: this is intended to speedup the whole strategy by discarding obvious cases.
Collaborator
Author
There was a problem hiding this comment.
For me it's correctness. I shouldn't merge reg classes that aren't equivalent in e.g. spill size. But perhaps there are sanity rules that I don't know of.
Collaborator
Author
There was a problem hiding this comment.
More detail: I check the result class only against RC[0].
Generated reg itin pairs tend to split register sets in their subsets, all yielding the same itinerary. By recognising those equivalences and reverting to the largest superset we gain several advantages: 1- There are less entries to check. This saves table size and compile time spent in table lookup. 2- For reverse-lookup purposes, i.e. finding register classes compatible with physical register occurrences, we end up at wider sets with more allocation freedom.
0a0709d to
66f1b53
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.
Lo-priority
Generated reg itin pairs tend to split register sets in their subsets, all yielding the same itinerary.
By recognising those equivalences and reverting to the largest superset we gain several advantages:
1- There are less entries to check. This saves table size and compile time
spent in table lookup.
2- For reverse-lookup purposes, i.e. finding register classes compatible with
physical register occurrences, we end up at wider sets with more allocation
freedom.