[Beignet] [PATCH 9/9] GBE: avoid vector registers when there is high register pressure.

Zhigang Gong zhigang.gong at intel.com
Wed Sep 23 17:47:33 PDT 2015


If the reservedSpillRegs is not zero, it indicates we are in a
very high register pressure. Use register vector will likely
increase that pressure and will cause significant performance
problem which is much worse than use a short-live temporary
vector register with several additional MOVs.

So let's simply avoid use vector registers and just use a
temporary short-live-interval vector.

v2:
remove out-of-date comments.

Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
---
 backend/src/backend/gen_reg_allocation.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/backend/src/backend/gen_reg_allocation.cpp b/backend/src/backend/gen_reg_allocation.cpp
index 39f1934..3f6abf3 100644
--- a/backend/src/backend/gen_reg_allocation.cpp
+++ b/backend/src/backend/gen_reg_allocation.cpp
@@ -313,12 +313,10 @@ 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->isScalarReg(reg) == false &&
           ctx.isSpecialReg(reg) == false &&
-          (intervals[reg].maxID - intervals[reg].minID) < 2048)
+          ctx.reservedSpillRegs == 0 )
       {
         const VectorLocation location = std::make_pair(vector, regID);
         this->vectorMap.insert(std::make_pair(reg, location));
-- 
1.9.1



More information about the Beignet mailing list