Make Phi-funs not count as uses in next-use-distance update.
Next-use-distance analysis would count Phis as uses, so when updating NUD, distance of all Phi args ended up the same. This does not line-up with how Spiller looks at loop headers and so we end up spilling and reloading values live at the loop header. This change makes it so that initial NUD calculation still works (does not loop infinitely bc. of increasing distance bc. of loop exit weight), but update works as expected.
Showing
- compiler/GHC/CmmToAsm/SSA/NextUseDistance.hs 67 additions, 10 deletionscompiler/GHC/CmmToAsm/SSA/NextUseDistance.hs
- compiler/GHC/CmmToAsm/SSA/Spill.hs 8 additions, 17 deletionscompiler/GHC/CmmToAsm/SSA/Spill.hs
- compiler/GHC/CmmToAsm/SSA/Utils.hs 11 additions, 1 deletioncompiler/GHC/CmmToAsm/SSA/Utils.hs
Loading
Please register or sign in to comment