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

[compiler] Fix for consecutive DCE'd branches with phis #31959

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

Conversation

josephsavona
Copy link
Contributor

This is an optimized version of @asmjmp0's fix in #31940. When we merge consecutive blocks we need to take care to rewrite later phis whose operands will now be different blocks due to merging. Rather than iterate all the blocks on each merge as in #31940, we can do a single iteration over all the phis at the end to fix them up.

This is an optimized version of @asmjmp0's fix in facebook#31940. When we merge consecutive blocks we need to take care to rewrite later phis whose operands will now be different blocks due to merging. Rather than iterate all the blocks on each merge as in facebook#31940, we can do a single iteration over all the phis at the end to fix them up.
Copy link

vercel bot commented Jan 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ❌ Failed (Inspect) Jan 2, 2025 7:24pm

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jan 2, 2025
Comment on lines +1 to +20
function Component() {
let v3, v4, acc;
v3 = false;
v4 = v3;
acc = v3;
if (acc) {
acc = true;
v3 = acc;
}
if (acc) {
v3 = v4;
}
v4 = v3;
return [acc, v3, v4];
}

export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [],
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a great repro case, thank you @asmjmp0!

@josephsavona
Copy link
Contributor Author

Closes #31940

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants