From: Zhigang Gong Date: Fri, 21 Feb 2014 02:40:08 +0000 (+0800) Subject: GBE: don't put a long live register to a selection vector. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3713d5e8f517eb9468fad0a8fc9102c451e7d72e;p=contrib%2Fbeignet.git GBE: don't put a long live register to a selection vector. If an element has very long interval, we don't want to put it into a vector as it will add more pressure to the register allocation. With this patch, it can reduce more than 20% spill registers for luxmark's median scene benchmark(from 288 to 224). Signed-off-by: Zhigang Gong Reviewed-by: "Song, Ruiling" --- diff --git a/backend/src/backend/gen_reg_allocation.cpp b/backend/src/backend/gen_reg_allocation.cpp index 4e276c3..c282b36 100644 --- a/backend/src/backend/gen_reg_allocation.cpp +++ b/backend/src/backend/gen_reg_allocation.cpp @@ -271,9 +271,12 @@ namespace gbe // case 1: the register is not already in a vector, so it can stay in this // vector. Note that local IDs are *non-scalar* special registers but will // require a MOV anyway since pre-allocated in the CURBE + // If an element has very long interval, we don't want to put it into a + // vector as it will add more pressure to the register allocation. if (it == vectorMap.end() && ctx.sel->isScalarOrBool(reg) == false && - ctx.isSpecialReg(reg) == false) + ctx.isSpecialReg(reg) == false && + (intervals[reg].maxID - intervals[reg].minID) < 2048) { const VectorLocation location = std::make_pair(vector, regID); this->vectorMap.insert(std::make_pair(reg, location));