Skip to content

Commit

Permalink
[compiler] Maintain RPO and unique instruction ids when constructing …
Browse files Browse the repository at this point in the history
…scope terminals

Later passes may rely on HIR invariants such as blocks being in RPO or instructions having unique, ascending InstructionIds. However, BuildReactiveScopeTerminalsHIR doesn't currently gurantee this.

This PR updates that pass to first restore RPO, fixup predecessors (the previous logic tried to do this but failed on unreachable blocks, where `markPredecessors()` handles that case), and renumber instructions. Then it walks instructions and scopes to update identifier and scope ranges given the new instruction ids.

ghstack-source-id: 2a99df02ac9d125b202cae369e2dc4dccefb0625
Pull Request resolved: facebook#30399
  • Loading branch information
felixshiftellecon committed Jul 24, 2024
1 parent f987f1a commit 3791fa6
Showing 1 changed file with 271 additions and 255 deletions.
Loading

0 comments on commit 3791fa6

Please sign in to comment.