-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Don't add compensation code for array values in prepass. OS#17527968 #5535
Conversation
if (p > 2) { | ||
t = b; | ||
b = a; | ||
} |
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.
If we don't add compenstation in the prepass, won't we end up with a null lengthSym in this case in the merge block ?
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.
only in the prepass. it will be fixed up in the main pass
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.
After some more offline discussions with @meg-gupta, we concluded that, yes, b
will end with a null lengthSym in the block after the if block. This, when merged with the lengthSym from the landing pad, will result in a null length sym for b
in the main pass.
While this is not ideal, its also not a regression from the pre-AggressiveValueTransfer days. I'll keep the fix as is for now, but keep a note of the possible optimization opportunity.
@dotnet-bot test Windows 10 ci_slow_x64_debug please |
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.
:shipit |
… prepass. OS#17527968 Merge pull request #5535 from rajatd:avt-array With aggressive transfer of values in loop prepass, an assignment of an array will result in an Array kind value for the dst (without value transfer in prepass, it would have been a Generic kind value). Globopt, when trying to merge two Array kind values from two edges, will try to insert compensation code if, for example, the length sym on the two values is different. We are currently hitting an assert that we should only be inserting compensation code in the main pass of the loop. Before AVT, we wouldn't even have tried to insert compensation because the value types on the two edges would be different. Given the timeframe and release being shutdown, I'm changing the code so it only inserts compensation code in the main pass (instead of inserting compensation in prepass). This matches the behaviour to what we had before AVT. Thanks @meg-gupta for the reduction on this one.
…rray values in prepass. OS#17527968 Merge pull request #5535 from rajatd:avt-array With aggressive transfer of values in loop prepass, an assignment of an array will result in an Array kind value for the dst (without value transfer in prepass, it would have been a Generic kind value). Globopt, when trying to merge two Array kind values from two edges, will try to insert compensation code if, for example, the length sym on the two values is different. We are currently hitting an assert that we should only be inserting compensation code in the main pass of the loop. Before AVT, we wouldn't even have tried to insert compensation because the value types on the two edges would be different. Given the timeframe and release being shutdown, I'm changing the code so it only inserts compensation code in the main pass (instead of inserting compensation in prepass). This matches the behaviour to what we had before AVT. Thanks @meg-gupta for the reduction on this one.
With aggressive transfer of values in loop prepass, an assignment of an array will result in an Array kind value for the dst (without value transfer in prepass, it would have been a Generic kind value).
Globopt, when trying to merge two Array kind values from two edges, will try to insert compensation code if, for example, the length sym on the two values is different. This compensation code is unnecessary to add in the prepass as the length syms would again be different on the two edges on the main path.
Thanks @meg-gupta for the reduction on this one.