[Beignet] [PATCH 2/5] GBE: fix one post register allocation instruction scheduling bug.

Zhigang Gong zhigang.gong at intel.com
Wed May 21 18:41:49 PDT 2014


The instuction has modFlag 1 indicating it will modify the flag.

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

diff --git a/backend/src/backend/gen_insn_scheduling.cpp b/backend/src/backend/gen_insn_scheduling.cpp
index a711f45..c3c4728 100644
--- a/backend/src/backend/gen_insn_scheduling.cpp
+++ b/backend/src/backend/gen_insn_scheduling.cpp
@@ -338,7 +338,7 @@ namespace gbe
     }
 
     // Track writes in predicates
-    if (insn.opcode == SEL_OP_CMP || insn.opcode == SEL_OP_I64CMP) {
+    if (insn.opcode == SEL_OP_CMP || insn.opcode == SEL_OP_I64CMP || insn.state.modFlag) {
       const uint32_t index = this->getIndex(getFlag(insn));
       this->nodes[index] = node;
     }
@@ -460,7 +460,7 @@ namespace gbe
         tracker.addDependency(node, insn.dst(dstID));
 
       // write-after-write for predicate
-      if (insn.opcode == SEL_OP_CMP || insn.opcode == SEL_OP_I64CMP)
+      if (insn.opcode == SEL_OP_CMP || insn.opcode == SEL_OP_I64CMP || insn.state.modFlag)
         tracker.addDependency(node, getFlag(insn));
 
       // write-after-write for accumulators
@@ -530,7 +530,7 @@ namespace gbe
     // Make labels and branches non-schedulable (i.e. they act as barriers)
     for (int32_t insnID = 0; insnID < insnNum; ++insnID) {
       ScheduleDAGNode *node = tracker.insnNodes[insnID];
-      if (node->insn.isBranch() || node->insn.isLabel() || node->insn.opcode == SEL_OP_EOT)
+      if (node->insn.isBranch() || node->insn.isLabel() || node->insn.opcode == SEL_OP_EOT || node->insn.opcode == SEL_OP_IF)
         tracker.makeBarrier(insnID, insnNum);
     }
 
-- 
1.8.3.2



More information about the Beignet mailing list