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

Refactor SIMPLIFY_BRANCH_ARITHMETIC Macro #7307

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

Conversation

jmesyou
Copy link
Contributor

@jmesyou jmesyou commented Apr 10, 2024

This commit removes the SIMPLIFY_BRANCH_ARITHMETIC and replaces it with a templated instantiation that seeks to emulate a closure. The templated class is provided with the mutators and accessors for nodes so tha tthe notation of passing in getter names through the macro is no longer needed

The logic from the original macro to check whether a node is a viable candidate for simplification and which optimization to perform is simplified.

The old macro also contained side effects which modified the local variables at the call site and this has been removed and replaced with equivalent semantics.

This commit removes the SIMPLIFY_BRANCH_ARITHMETIC and replaces
it with a templated instantiation that seeks to emulate a closure.
The templated class is provided with the mutators and accessors
for nodes so tha tthe notation of passing in getter names through
the macro is no longer needed

The logic from the original macro to check whether a
node is a viable candidate for simplification and which
optimization to perform is simplified.

The old macro also contained side effects which modified
the local variables at the call site and this has been
removed and replaced with equivalent semantics.

Signed-off-by: James You <james.you@protonmail.com>
@jmesyou jmesyou marked this pull request as draft April 10, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant