-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Loosen Globopt assert when called from HoistInvariantValueInfo #4567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
chakrabot
merged 1 commit into
chakra-core:release/1.8
from
meg-gupta:lossenGlobOptAssert
Jan 18, 2018
Merged
Loosen Globopt assert when called from HoistInvariantValueInfo #4567
chakrabot
merged 1 commit into
chakra-core:release/1.8
from
meg-gupta:lossenGlobOptAssert
Jan 18, 2018
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
Fixes OS#15189393
Example:
confusedSym = ..[]; // non object value type
landingPad :
loopTop :
= LdElem[confusedSym + ...] // non-object value type in first pass, object value type in second pass
= LdFld[confusedSym...] // object value type
loopEnd
confusedSym is invariant in this loop, for some reason if we fail to hoist the LdFld, then this assert will fire when we try to hoist the LdElem.
Because optimization of LdFld will force combine the valuetype of confusedSym with Object, and in the second pass while optimizing LdElem in HoistInvariantValueInfo,
we will call ChangeValueInfo and this assert will fire.
This is because we are trying to change a non-object valuetype to an object valuetype.
AreValueTypesCompatible function converts to definite valuetypes before checking if they are compatible.
The check doesn't care if both of them are likely.
Globopt calls ChangeValueInfo with allowIncompatiblyTypes set to false in most cases where we are transforming specific to generic/generic to specific like Typespecialization etc.
It calls ChangeValueInfo with allowIncompatiblyTypes set to true, where we can expect incompatible types ex: UpdateObjPtrValueInfo.
This fix calls ChangeValueInfo from HoistInvariantValueInfo with allowIncompatiblyTypes set to true.
LouisLaf
approved these changes
Jan 18, 2018
Collaborator
LouisLaf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
chakrabot
pushed a commit
that referenced
this pull request
Jan 18, 2018
…InvariantValueInfo Merge pull request #4567 from meg-gupta:lossenGlobOptAssert Fixes OS#15189393 Example: ``` invariantSym = ..[]; // non object value type landingPad : loopTop : = LdElem[invariantSym + ...] // non-object value type in first pass, object value type in second pass = LdFld[invariantSym...] // object value type loopEnd ``` invariantSym is invariant in this loop, for some reason if we fail to hoist the LdFld, then assert saying valueInfos are incompatible will fire, when we try to hoist the LdElem. Because optimization of LdFld will force combine the valuetype of invariantSym with Object, and in the second pass while optimizing LdElem in HoistInvariantValueInfo, we will call ChangeValueInfo and this assert will fire. This is because we are trying to change a non-object valuetype to an object valuetype. AreValueTypesCompatible function converts to definite valuetypes before checking if they are compatible. The check doesn't care if both of them are likely. Globopt calls ChangeValueInfo with allowIncompatiblyTypes set to false in most cases where we are transforming specific to generic/generic to specific like Typespecialization etc. It calls ChangeValueInfo with allowIncompatiblyTypes set to true, where we can expect incompatible types ex: UpdateObjPtrValueInfo. This fix calls ChangeValueInfo from HoistInvariantValueInfo with allowIncompatiblyTypes set to true.
chakrabot
pushed a commit
that referenced
this pull request
Jan 18, 2018
…from HoistInvariantValueInfo Merge pull request #4567 from meg-gupta:lossenGlobOptAssert Fixes OS#15189393 Example: ``` invariantSym = ..[]; // non object value type landingPad : loopTop : = LdElem[invariantSym + ...] // non-object value type in first pass, object value type in second pass = LdFld[invariantSym...] // object value type loopEnd ``` invariantSym is invariant in this loop, for some reason if we fail to hoist the LdFld, then assert saying valueInfos are incompatible will fire, when we try to hoist the LdElem. Because optimization of LdFld will force combine the valuetype of invariantSym with Object, and in the second pass while optimizing LdElem in HoistInvariantValueInfo, we will call ChangeValueInfo and this assert will fire. This is because we are trying to change a non-object valuetype to an object valuetype. AreValueTypesCompatible function converts to definite valuetypes before checking if they are compatible. The check doesn't care if both of them are likely. Globopt calls ChangeValueInfo with allowIncompatiblyTypes set to false in most cases where we are transforming specific to generic/generic to specific like Typespecialization etc. It calls ChangeValueInfo with allowIncompatiblyTypes set to true, where we can expect incompatible types ex: UpdateObjPtrValueInfo. This fix calls ChangeValueInfo from HoistInvariantValueInfo with allowIncompatiblyTypes set to true.
chakrabot
pushed a commit
that referenced
this pull request
Jan 18, 2018
… when called from HoistInvariantValueInfo Merge pull request #4567 from meg-gupta:lossenGlobOptAssert Fixes OS#15189393 Example: ``` invariantSym = ..[]; // non object value type landingPad : loopTop : = LdElem[invariantSym + ...] // non-object value type in first pass, object value type in second pass = LdFld[invariantSym...] // object value type loopEnd ``` invariantSym is invariant in this loop, for some reason if we fail to hoist the LdFld, then assert saying valueInfos are incompatible will fire, when we try to hoist the LdElem. Because optimization of LdFld will force combine the valuetype of invariantSym with Object, and in the second pass while optimizing LdElem in HoistInvariantValueInfo, we will call ChangeValueInfo and this assert will fire. This is because we are trying to change a non-object valuetype to an object valuetype. AreValueTypesCompatible function converts to definite valuetypes before checking if they are compatible. The check doesn't care if both of them are likely. Globopt calls ChangeValueInfo with allowIncompatiblyTypes set to false in most cases where we are transforming specific to generic/generic to specific like Typespecialization etc. It calls ChangeValueInfo with allowIncompatiblyTypes set to true, where we can expect incompatible types ex: UpdateObjPtrValueInfo. This fix calls ChangeValueInfo from HoistInvariantValueInfo with allowIncompatiblyTypes set to true.
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 OS#15189393
Example:
invariantSym is invariant in this loop, for some reason if we fail to hoist the LdFld, then assert saying valueInfos are incompatible will fire, when we try to hoist the LdElem.
Because optimization of LdFld will force combine the valuetype of invariantSym with Object, and in the second pass while optimizing LdElem in HoistInvariantValueInfo,
we will call ChangeValueInfo and this assert will fire.
This is because we are trying to change a non-object valuetype to an object valuetype.
AreValueTypesCompatible function converts to definite valuetypes before checking if they are compatible.
The check doesn't care if both of them are likely.
Globopt calls ChangeValueInfo with allowIncompatiblyTypes set to false in most cases where we are transforming specific to generic/generic to specific like Typespecialization etc.
It calls ChangeValueInfo with allowIncompatiblyTypes set to true, where we can expect incompatible types ex: UpdateObjPtrValueInfo.
This fix calls ChangeValueInfo from HoistInvariantValueInfo with allowIncompatiblyTypes set to true.