GBE: Fix live range for temporary register in replaceReg
authorRuiling Song <ruiling.song@intel.com>
Tue, 4 Nov 2014 07:22:40 +0000 (15:22 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Tue, 4 Nov 2014 07:24:36 +0000 (15:24 +0800)
commit66a9a2480a2141a318e0076d69300839f3ef6864
treee70281ac53acad3486a4d708f151c41d34e763f0
parent7987b7996daebeed8a8c0023d6f1b29dcb28951c
GBE: Fix live range for temporary register in replaceReg

previously it is simply assigned as [insnID, insnID], But it is used in 2 instruction:
[1] MOV tmp, replacedReg
[2] send null, addr, tmp,...

As minID maxID is equal, it will be treated as temporary register during spill,
and no scratch memory allocated. But scratch register is allocated per instruction,
if tmp in [1] is assigned g100 from spill register pool, instruction [2] would have no idea of that,
it will assign another register like g102 from spill register pool. As no scratch memory allocated,
we cannnot do any spill/unspill operation between them.

To fix this issue, I change the liveness range according to isSrc, so spill/unspill
could work as normally.

This patch fix the cos16 test case failure in piglit under strict conformance.

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