[WaveTransform] Widen back-edge i1 PHI operands instead of keeping them as lane masks#3371
Open
TejaX-Alaghari wants to merge 2 commits into
Conversation
…rked as a lane mask
|
PSDB Build Link: http://mlse-bdc-20dd129:8065/#/builders/10/builds/694 |
|
PSDB Build Link: http://mlse-bdc-20dd129:8065/#/builders/10/builds/695 |
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.
Currently, a divergent
i1whose only use is the loop-header PHI it feeds through a self-back-edge was wrongly reclassified as a block-local lane mask byAMDGPUFinalizeISelWaveTransform(incanTreatAsLocalLaneMask()).It makes that decision by checking whether the value feeding PHI "leaves" its block, but a PHI operand belongs to its predecessor edge, not the block the PHI sits in — so a self-back-edge use looks local when it isn't.
Because the PHI destination is always widened to
vgpr_32, this produced a mixed-classvgpr_32 = PHI(vgpr_32, <lane mask>):32-bit-VGPR = COPY 64-bit-SGPRand asserts inSIInstrInfo::copyPhysRegduring Post-RA pseudo expansion.i1(miscompile).This PR aims to fix this behavior by treating any PHI use as leaving the block. Every
vreg_1PHI is unconditionally widened tovgpr_32, so a value feeding one can never stay a lane mask.