Repository navigation
[Codegen] Replace LICM with a version that checks trip count - #18679
Merged
Merged
Conversation
qedawkins
requested review from
Groverkss,
MaheshRavishankar,
antiagainst,
benvanik,
hanhanW and
kuhar
as code owners
October 3, 2024 15:39
kuhar
reviewed
Oct 3, 2024
Contributor
Author
MaheshRavishankar
left a comment
Collaborator
There was a problem hiding this comment.
I can stamp this, but might be also worth fixing the upstream hositing for for loop, and keep this just to avoid hoisting from for_all loops.
Contributor
Author
|
This is the last remaining change blocking #18474 (at least for CI, I'm still going to try to get a model sweep done first) and that PR is the fix to another issue and has been brewing for a while so I'd like to land it sooner rather than later. |
nirvedhmeshram
approved these changes
Oct 14, 2024
nirvedhmeshram
left a comment
Contributor
There was a problem hiding this comment.
LGTM, but lets wait for approval from Mahesh or Jakub.
Groverkss
reviewed
Oct 14, 2024
Groverkss
left a comment
Contributor
There was a problem hiding this comment.
To avoid problems with the word "safe", can we rename this to IREELoopInvariantCodeMotion?
The upstream LICM pass does no verification that it is safe to hoist an op out of a loop (i.e. the loop has >= 1 trip count). This replaces all uses of LICM in codegen with a version that does this verification. Other phases of the compiler probably should switch as well.
MaheshRavishankar
approved these changes
Oct 15, 2024
Groverkss
approved these changes
Oct 15, 2024
kuhar
approved these changes
Oct 15, 2024
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 upstream LICM pass does no verification that it is safe to hoist an op out of a loop (i.e. the loop has >= 1 trip count). This replaces all uses of LICM in codegen with a version that does this verification. Other phases of the compiler probably should switch as well.