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

[interp] Optimize conditional branches #52130

Merged
merged 6 commits into from
May 4, 2021

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Apr 30, 2021

Stop generating MINT_SAFEPOINT opcodes, add _imm versions to conditional branches.

Remove some other unnecessary opcodes

BrzVlad added 2 commits April 26, 2021 10:26
Unlike initlocal ldc_0 are propagated, also having smaller instruction footprint. Signal retry of cprop when we are adding such instructions, also in other cases. We could dynamically update the state, but let's not overcomplicate the cprop pass, for now.
@BrzVlad BrzVlad requested a review from vargaz as a code owner April 30, 2021 19:30
BrzVlad added 4 commits May 4, 2021 12:18
On netcore, there are no context static fields so all special static fields are thread static. These thread static accessors are not very common, so just remove redundant opcodes for them, and use ldind/ldobj.vt and stind/stobj.vt instead.
These opcodes were used for loading a field of a VT var. This means the opcodes were loading a value from an immediate offset added to a var offset. We can use the standard MINT_MOV opcodes for this, however we need to resolve the offsets at the very end, so it doesn't interfere with other compilation passes, since the final offset is not the real offset of a variable, but rather an offset inside a VT var.
It was used to check for abort requests during backward branches. Also stop checking for abort requests in other places.
We include the safepoint in the instruction and also the immediate comparison value if possible. Doing the safepoint by default in branching opcodes is questionable since, in a typical program, forward branches are far more common than backward branches.

We should really remove many of the branching opcodes. We now have the possibility to swap the src vars order, and use the opposite comparison instead.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants