Implement spill/unspill
authorRuiling Song <ruiling.song@intel.com>
Wed, 7 Aug 2013 07:15:50 +0000 (15:15 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Wed, 7 Aug 2013 07:43:13 +0000 (15:43 +0800)
commite23c8b7dfd806b38a7a1b618efecfb0c7f2f5c62
treefbbbfae12f1207817e7c5249a7d506b76f3a12e4
parent812df4f17e4156ee3597870de4b4dc33595dfb0a
Implement spill/unspill

The current implementation works like below:
I reserve a pool of registers for spill/reload. Currently 6 registers
are reserved to handle SelectionVector with at most 5 elements.
The other one is used as scratch message header register. The register
after header register was used as the payload for scratch write.

To do spill, just iterate the instructions. If the virtual register
was used as src, insert reload instruction before it. If the virtual
register was used as dst, insert spill instruction to write the register
content to scratch memory.

Limitations yet:
64bit not support.
SelectionVector > 5 not handled.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
backend/src/backend/gen_context.cpp
backend/src/backend/gen_context.hpp
backend/src/backend/gen_insn_gen7_schedule_info.hxx
backend/src/backend/gen_insn_scheduling.cpp
backend/src/backend/gen_insn_selection.cpp
backend/src/backend/gen_insn_selection.hpp
backend/src/backend/gen_insn_selection.hxx
backend/src/backend/gen_reg_allocation.cpp