You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Until now we've ignored PHINode operands inside our liveness analysis,
since the algorithm we are using did not consider SSA. With the recent
change in yk which uses stackmap calls to collect live values for
deoptimisation, we no longer get away with this.
The difficulty with PHINodes, is that marking their operands live means the
backwards running liveness algorithm will consider values live in blocks
where they can never appear. For example, let's consider a branch in a
block A splitting to block B and C, which then both diverge into block D.
The PHINode at the beginning of block D might look like this:
`%10 = phi [B, %5], [C, %7]`
The backwards running pass would now consider `%5` and `%7` live in both
block B and C, even though only one of the values was defined in each. This
is incorrect and leads to non-existing values inside some stackmap calls.
The fix is relatively simple. At the end of each block we mark each value
that wasn't defined inside this block as if it was. For example, at the end
of block B we mark `%7` as defined, and do the same for block C and value
`%5`. This means the backwards pass immediately kills those values when
entering the block, which means the non-existing values are no longer live
at that point and won't be inserted into any earlier stackmap calls.
0 commit comments