[AMDGPU] Detect VALU-after-MFMA hazard in post-RA scheduler's getHaza…#1614
Open
gandhi56 wants to merge 1 commit intoamd-stagingfrom
Open
[AMDGPU] Detect VALU-after-MFMA hazard in post-RA scheduler's getHaza…#1614gandhi56 wants to merge 1 commit intoamd-stagingfrom
gandhi56 wants to merge 1 commit intoamd-stagingfrom
Conversation
Collaborator
…rdType Add a check for the VALU-immediately-after-MFMA hazard in getHazardType so the post-RA scheduler can avoid scheduling a non-MFMA VALU instruction immediately after an MFMA with no intervening stall cycle. Previously this hazard was only handled in PreEmitNoopsCommon (used by the PostRAHazardRecognizer pass). The scheduler path did not consider it, so the scheduler could place a VALU right after an MFMA and rely on later noop insertion. By checking in getHazardType, the scheduler can prefer other instructions or add stall cycles instead. Introduce checkVALUImmediatelyAfterMFMAHazard to centralize the logic. It walks EmittedInstrs in emission order and returns 1 if an MFMA was the last emitted instruction with no stall cycle in between, otherwise 0.
591875e to
2538e39
Compare
Collaborator
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.
Add a check for the VALU-immediately-after-MFMA hazard in getHazardType so the
post-RA scheduler can avoid scheduling a non-MFMA VALU instruction immediately
after an MFMA with no intervening stall cycle.
Previously this hazard was only handled in PreEmitNoopsCommon (used by the
PostRAHazardRecognizer pass). The scheduler path did not consider it, so the
scheduler could place a VALU right after an MFMA and rely on later noop
insertion. By checking in getHazardType, the scheduler can prefer other
instructions or add stall cycles instead.
Introduce checkVALUImmediatelyAfterMFMAHazard to centralize the logic. It walks
EmittedInstrs in emission order and returns 1 if an MFMA was the last emitted
instruction with no stall cycle in between, otherwise 0.