This patch LGTM.

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Zhigang Gong
Sent: Monday, December 30, 2013 7:07 PM
To: [email protected]
Cc: Gong, Zhigang
Subject: [Beignet] [PATCH 2/4] GBE: refine the register expiring handling.

Previous implementation expires one register each time which is not every 
efficient, now change to expire as much as possible registers.

Signed-off-by: Zhigang Gong <[email protected]>
---
 backend/src/backend/gen_reg_allocation.cpp |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/backend/src/backend/gen_reg_allocation.cpp 
b/backend/src/backend/gen_reg_allocation.cpp
index d7362dd..2bb0d19 100644
--- a/backend/src/backend/gen_reg_allocation.cpp
+++ b/backend/src/backend/gen_reg_allocation.cpp
@@ -276,6 +276,7 @@ namespace gbe
   }
 
   bool GenRegAllocator::Opaque::expireGRF(const GenRegInterval &limit) {
+    bool ret = false;
     while (this->expiringID != ending.size()) {
       const GenRegInterval *toExpire = this->ending[this->expiringID];
       const ir::Register reg = toExpire->reg; @@ -299,7 +300,7 @@ namespace gbe
       }
 
       if (toExpire->maxID >= limit.minID)
-        return false;
+        break;
       auto it = RA.find(reg);
       GBE_ASSERT(it != RA.end());
       // offset less than 32 means it is not managed by our reg allocator.
@@ -310,11 +311,11 @@ namespace gbe
       // Case 1 - it does not belong to a vector. Just remove it
         ctx.deallocate(it->second);
         this->expiringID++;
-        return true;
+        ret = true;
     }
 
     // We were not able to expire anything
-    return false;
+    return ret;
   }
 
   void GenRegAllocator::Opaque::allocateFlags(Selection &selection) {
--
1.7.9.5

_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet
_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to