LoongArch64: avoid SGEMM LA464 ncopy fallthrough from N2 to N1#5902
Open
wxpppp wants to merge 1 commit into
Open
LoongArch64: avoid SGEMM LA464 ncopy fallthrough from N2 to N1#5902wxpppp wants to merge 1 commit into
wxpppp wants to merge 1 commit into
Conversation
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.
Problem
The .L_N2 tail path handles a remaining 2-column block. After that path completes, the original code could directly jump or fall through into .L_N1.
However, .L_N1 handles a remaining 1-column block, so entering .L_N1 should depend on N & 1.
The original code used M & 1:
M & 1 only indicates whether the current 2-column block has one remaining row. It does not indicate whether there is one remaining column.
This can cause the kernel to process an extra column after .L_N2, leading to an out-of-bounds read when the column tail contains 2 but not 1.
For example:
Fix
Add an .L_N2_END block and check N & 1 before falling through into .L_N1.