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

Code Quality: use legalizePostRegAlloc flag on Func instead of passing bool to Legalizers #5504

Merged
merged 1 commit into from
Jul 24, 2018

Conversation

sigatrev
Copy link
Contributor

ARM and ARM64 legalizers behave differently before and after register allocation. We've had bugs in the past where, mainly through static helper functions similar to Lowerer::InsertMove where we've had the flag wrong. This commit adds a flag on Func to tell the legalizer if it should behave as if register allocation has happened or not, and removes the need to pass the flags. The flag was not used on x86 and x64

There were a couple of places where the flag passed did not agree with whether register allocation has finished, in particular LinearScan::InsertLea (passed the flag true) and ARM and ARM64 LowererMD::ChangeToAssign (always passed false). I've added an RAII auto-restore helper to change the flag on the Func while those calls are in progress . While not ideal, it does have the benefit of being mroe expressive.

I'm using a new flag instead of the existing (dbg only) isPostRegAlloc flag because the flag can be temporarily overriden.

…g bool to Legalizers

ARM and ARM64 legalizers behave differently before and after register allocation. We've had bugs in the past where, mainly through static helper functions similar to Lowerer::InsertMove where we've had the flag wrong. This commit adds a flag on Func to tell the legalizer if it should behave as if register allocation has happened or not, and removes the need to pass the flags. The flag was not used on x86 and x64

There were a couple of places where the flag passed did not agree with whether register allocation has finished, in particular LinearScan::InsertLea (passed the flag true) and ARM and ARM64 LowererMD::ChangeToAssign (always passed false). I've added an RAII auto-restore helper to change the flag on the Func while those calls are in progress . While not ideal, it does have the benefit of being mroe expressive.

I'm using a new flag instead of the existing (dbg only) isPostRegAlloc flag because the flag can be temporarily overriden.
@sigatrev sigatrev force-pushed the users/magardn/legalize branch from 2e299d4 to aa4bc74 Compare July 24, 2018 00:50
@chakrabot chakrabot merged commit aa4bc74 into chakra-core:release/1.10 Jul 24, 2018
chakrabot pushed a commit that referenced this pull request Jul 24, 2018
…n Func instead of passing bool to Legalizers

Merge pull request #5504 from sigatrev:users/magardn/legalize

ARM and ARM64 legalizers behave differently before and after register allocation. We've had bugs in the past where, mainly through static helper functions similar to Lowerer::InsertMove where we've had the flag wrong. This commit adds a flag on Func to tell the legalizer if it should behave as if register allocation has happened or not, and removes the need to pass the flags. The flag was not used on x86 and x64

There were a couple of places where the flag passed did not agree with whether register allocation has finished, in particular LinearScan::InsertLea (passed the flag true) and ARM and ARM64 LowererMD::ChangeToAssign (always passed false). I've added an RAII auto-restore helper to change the flag on the Func while those calls are in progress . While not ideal, it does have the benefit of being mroe expressive.

I'm using a new flag instead of the existing (dbg only) isPostRegAlloc flag because the flag can be temporarily overriden.
chakrabot pushed a commit that referenced this pull request Jul 24, 2018
…egAlloc flag on Func instead of passing bool to Legalizers

Merge pull request #5504 from sigatrev:users/magardn/legalize

ARM and ARM64 legalizers behave differently before and after register allocation. We've had bugs in the past where, mainly through static helper functions similar to Lowerer::InsertMove where we've had the flag wrong. This commit adds a flag on Func to tell the legalizer if it should behave as if register allocation has happened or not, and removes the need to pass the flags. The flag was not used on x86 and x64

There were a couple of places where the flag passed did not agree with whether register allocation has finished, in particular LinearScan::InsertLea (passed the flag true) and ARM and ARM64 LowererMD::ChangeToAssign (always passed false). I've added an RAII auto-restore helper to change the flag on the Func while those calls are in progress . While not ideal, it does have the benefit of being mroe expressive.

I'm using a new flag instead of the existing (dbg only) isPostRegAlloc flag because the flag can be temporarily overriden.
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.

3 participants