Free the second half of double register #46939
Merged
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.
As pointed out in my analysis in #46085 (comment), after #45135, we added a
DEBUGonly validation that checks if aRegRecorddoesn't have an assigned interval, it should be free and its entry should be present inm_AvailableRegsmask. However, for ARM, that invariant was not maintained.In Arm, a pair of registers are used to store value of
TYP_DOUBLE. However, if a register pair was previously assigned to an interval that hasTYP_DOUBLEvalue and we are currently trying to assign a register to an interval that hasTYP_FLOATvalue, we unassign both registers and re-assign one of the register of the pair to the current interval. However, we were not marking the other half register as free. This is done inliveRegsthat tracks the live variables. The fix was that whenever we see this happening, remove the other half register from theliveRegsmask, so it is considered as free.JitStressregs is green. The failures in JitStress2-JitStressRegs are unrelated and are because of the following issues:
Fixes: #46085