Skip to content
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

Merged
merged 1 commit into from
Jul 27, 2018

Conversation

rajatd
Copy link
Contributor

@rajatd rajatd commented Jul 26, 2018

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.

@rajatd rajatd requested review from LouisLaf and meg-gupta July 26, 2018 18:32
if (p > 2) {
t = b;
b = a;
}
Copy link
Contributor

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 ?

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

@rajatd
Copy link
Contributor Author

rajatd commented Jul 26, 2018

@dotnet-bot test Windows 10 ci_slow_x64_debug please

Copy link
Collaborator

@LouisLaf LouisLaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@meg-gupta
Copy link
Contributor

:shipit

@chakrabot chakrabot merged commit b7700e2 into chakra-core:release/1.10 Jul 27, 2018
chakrabot pushed a commit that referenced this pull request Jul 27, 2018
… 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.
chakrabot pushed a commit that referenced this pull request Jul 27, 2018
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants