[Beignet] [PATCH] GBE: fix a regression bug at post phi copy optimization.

Zhigang Gong zhigang.gong at intel.com
Tue Oct 20 01:07:23 PDT 2015


Forgot to handle the undefined phi value set of BBs when
we replace registers. This information will be used at next
round DAG generation.

Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
---
 backend/src/ir/liveness.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/backend/src/ir/liveness.cpp b/backend/src/ir/liveness.cpp
index 414bf42..d48f067 100644
--- a/backend/src/ir/liveness.cpp
+++ b/backend/src/ir/liveness.cpp
@@ -82,6 +82,8 @@ namespace ir {
         if (info.liveOut.contains(from)) {
           info.liveOut.erase(from);
           info.liveOut.insert(to);
+          // FIXME, a hack method to avoid the "to" register be treated as
+          // uniform value.
           bb->definedPhiRegs.insert(to);
         }
         if (info.upwardUsed.contains(from)) {
@@ -92,6 +94,10 @@ namespace ir {
           info.varKill.erase(from);
           info.varKill.insert(to);
         }
+        if (bb->undefPhiRegs.contains(from)) {
+          bb->undefPhiRegs.erase(from);
+          bb->undefPhiRegs.insert(to);
+        }
       }
     }
   }
-- 
1.9.1



More information about the Beignet mailing list