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

variable folding #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

variable folding #28

wants to merge 1 commit into from

Conversation

Zer0xFF
Copy link
Contributor

@Zer0xFF Zer0xFF commented Jun 9, 2020

few patterns I've noticed that can be simplified, I couldn't detect any notable improvement, but this should in theory make constant propagation more efficient

bool src1cst = statement.src1.get()->GetSymbol().get()->IsConstant();
bool src2cst = statement.src2.get()->GetSymbol().get()->IsConstant();

if(src1cst || src2cst || !statement.src1.get()->Equals(statement.src2.get())) continue;
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not very good with logical expressions, so I just want to make sure I understand properly :)

This function transforms statements that have the same non-constant src1 and src2 operands?

Copy link
Contributor Author

@Zer0xFF Zer0xFF Jun 10, 2020

Choose a reason for hiding this comment

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

yes, (checking if they're constant is easier then checking if they're !(rel || reg || tmp)).

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.

2 participants