Skip to content

Conversation

josephsavona
Copy link
Member

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
Member 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
Member Author

Closes #31940

@asmjmp0
Copy link

asmjmp0 commented Jul 2, 2025

Any progress on this pr?

@josephsavona
Copy link
Member Author

Oops, lost track of this one. I’ll take a look next week.

josephsavona added a commit that referenced this pull request Jul 7, 2025
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.

Note: this is a redo of #31959
josephsavona added a commit that referenced this pull request Jul 8, 2025
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.

Note: this is a redo of #31959

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/33725).
* #33726
* __->__ #33725
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.

3 participants