Skip to content

SSA CFG: add shadow liveness - #17215

Open
clonker wants to merge 2 commits into
ssa-cfg-add-shadow-slot-kindfrom
ssa-cfg-add-shadow-liveness
Open

clonker wants to merge 2 commits into
ssa-cfg-add-shadow-slot-kindfrom
ssa-cfg-add-shadow-liveness

Conversation

@clonker

@clonker clonker commented Nov 12, 2026

Copy link
Copy Markdown
Member
  • adds ShadowLiveness: per block the phis whose shadows are live on entry and on exit
  • shadows are not SSA but SSU, so their liveness is computed by path exploration
  • LivenessAnalysis holds a ShadowLiveness exposes accessors to it, the stack layout generator starts consuming them in a follow-up
  • the input of an upsilon now counts as used at the exit of its block only if its write is live, i.e., it is the block's last upsilon for its phi and the shadow is live on exit (before, the input of every upsilon counted)
  • two assumptions:
    • reading the input at the exit requires that no upsilon sits ahead of its own phi in the phi's block, which is asserted
    • the walk asserts that every path from the entry to a phi passes an upsilon for it
  • the control flow graph tests print live shadows as ^phiN[1] under LiveIn and LiveOut, and under Used if live on entry but not on exit
  • the dot export prints upsilons at their position as ^phiN := value and a phi as phiN := φ(^phiN), instead of listing the upsilons as operands of the phi

@clonker
clonker added this pull request to stack #17216 November 12, 2026 11:03
@clonker clonker added experimental has dependencies The PR depends on other PRs that must be merged first labels Nov 12, 2026
@clonker
clonker force-pushed the ssa-cfg-add-shadow-liveness branch from 4e3aaee to 2968358 Compare November 14, 2026 14:17
@clonker
clonker removed this pull request from stack #17216 November 14, 2026 14:24
@clonker
clonker added this pull request to stack #17222 November 14, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experimental has dependencies The PR depends on other PRs that must be merged first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant