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

Add perm_var_cond_block rule #160

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

twevs
Copy link

@twevs twevs commented Apr 3, 2023

This helps with useless moves emitted by gcc 2.8.1 by turning

[statements]

into

if (variable)
{
    [statements]
}
else
{
    [statements]
}

Examples:
https://decomp.me/scratch/hQYzv -> https://decomp.me/scratch/LJdek
https://decomp.me/scratch/U0w1R -> https://decomp.me/scratch/S9QUe

Marking this as a draft for now as the code to generate if (variable1 || variable2) by trying to weed out duplicate expressions doesn't yet work.

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.

1 participant