GBE: Try expire some register before register allocation
authorRuiling Song <ruiling.song@intel.com>
Wed, 23 Apr 2014 06:31:29 +0000 (14:31 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Wed, 23 Apr 2014 05:58:27 +0000 (13:58 +0800)
1. This would free unused register asap, so it becomes easy to allocate
   contiguous registers.

2. We previously met many hidden register liveness issue. Let's try
   to reuse the expired register early. Then I think wrong liveness may
   easy to find.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
backend/src/backend/gen_reg_allocation.cpp

index 6ae2dc7..c45fed7 100644 (file)
@@ -879,6 +879,8 @@ namespace gbe
                                                        uint32_t size,
                                                        uint32_t alignment) {
     uint32_t grfOffset;
+
+    this->expireGRF(interval);
     while ((grfOffset = ctx.allocate(size, alignment)) == 0) {
       const bool success = this->expireGRF(interval);
       if (success == false) {