StrongerXi / soc

Compiler for a subset of OCaml
1 stars 0 forks source link

Fix spilling #33

Closed StrongerXi closed 3 years ago

StrongerXi commented 3 years ago

Fixes #29. Refer to it for more context and details.

Gist

For any temp to be spilled, always

Potential Optimizations

  1. Graph-coloring based allocator that accounts for interferences from a global perspective. (a simple print (1 + 2) shows how the greedy algorithm creates unnecessary spills due to lack of global perspective)
  2. Calculate interference based on live-ranges (or essentially rename the temps based on live-ranges).
  3. Don't spill all usage of temps -- only spill the one of them (i.e. break up 1 def-use chain part of live-interval)? Might take too many iterations in that case.