Repository navigation
Conversation
fixDstAlignment accepts a byte dst that starts at byte 1 of its execution channel, using the offset tryToAlignOperand reports. But when the operand itself can't be aligned, tryToAlignOperand returns without aligning its root declare, so that offset only holds relative to a declare RA may still place anywhere its own alignment allows. A word-aligned declare at byte 2 of a dword then puts the byte at byte 3, which Gen12LP doesn't support: the byte isn't written. Align the root declare to the execution type in that case. Fixes intel#456.
This branch has not been deployed
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.
Fixes #456.
HWConformity::fixDstAlignmentaccepts a byte destination that starts at byte 1 of its execution channel. It takes that offset fromtryToAlignOperandbut ignores the function's result. When the operand itself can't be aligned,tryToAlignOperandreturns false before aligning the operand's root declare (BuildIRImpl.cpp). The reported offset is then only relative to the declare, which RA may still place anywhere its own (word) alignment allows. If RA puts it at byte 2 of a dword, the byte lands at byte 3. Gen12LP can't write a byte destination there for a dword execution type, so the value is lost.The pattern comes from
localDefHoisting. It folds amovfrom a dword into element 1 of a 2-byte variable,mov (1|M0) r6.11<4>:b r6.4<0;1,0>:don TGL. DG2 and MTL generate the same instruction but happened to place it at byte 1.This aligns the root declare to the execution type in that case, using
tryToAlignOperandRootDcl. Other cases are unchanged.The new ocloc test
optimizations/byte-dst-root-align.cl(REQUIRES: regkeys, tgllp-supported) checks that no byte destination of a dword channel starts at byte 2 or 3. I ran its FileCheck lines against the ocloc output with and without the fix (it fails, then passes), but haven't run the LIT suite.I checked the fix by building it into libigc 2.41.5 (JuliaPackaging/Yggdrasil#15280) and testing on a Tiger Lake Iris Xe:
Assisted by: Opus 5.5