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
[MERGE chakra-core#4366@rajatd] Make Globopt fold branches on same operands instead of lowerer
Merge pull request chakra-core#4366 from rajatd:typeofLoopTail
In case when the two sources of a branch were the result of the identical typeof operations, globopt CSE'd the typeofs making both the sources of the branch to be the same operands. The lowerer then tries to do the smart thing by detecting identical sources and either emitting a direct branch or removing the branch altogether (depedending on the branch instruction).
This 'optimizing' behaviour of the lowerer becomes a problem when the target of the branch being removed is a loop top because the register allocator expects at least one back edge to a loop top label.
I'm fixing this by doing slightly better than what we do today - I'm adding code to the globopt to detect identical values on the operands of a branch and optimize it if possible. Globopt does the right thing with respect to loop top labels by editing the flowgraph to remove dead blocks.
0 commit comments