GBE: Fix register liveness issue under simd mode.
authorRuiling Song <ruiling.song@intel.com>
Mon, 24 Mar 2014 01:46:21 +0000 (09:46 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Tue, 25 Mar 2014 05:22:02 +0000 (13:22 +0800)
commit8bc5ac8b591a162837105c9b8dd430ab203e9dde
tree89c925cbf41b0ea4ef3037be85065377a4d1cbcd
parent28da2d400031860ee4f9f936ef91bf75c5d2c8cd
GBE: Fix register liveness issue under simd mode.

As we run in SIMD mode with prediction mask to indicate active lanes,
If a vreg is defined in a loop, and there are som uses of the vreg out of the loop,
the define point may be run several times under *different* prediction mask.
For these kinds of vreg, we must extend the vreg liveness into the whole loop.
If we don't do this, it's liveness is killed before the def point inside loop.
If the vreg's corresponding physical reg is assigned to other vreg during the
killed period, and the instructions before kill point were re-executed with different prediction,
the inactive lanes of vreg maybe over-written. Then the out-of-loop use will got wrong data.

This patch fixes the HaarFixture case in opencv.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
backend/src/backend/gen_context.hpp
backend/src/backend/gen_reg_allocation.cpp
backend/src/ir/context.cpp
backend/src/ir/function.cpp
backend/src/ir/function.hpp
backend/src/ir/liveness.cpp
backend/src/ir/liveness.hpp
backend/src/llvm/llvm_gen_backend.cpp