From e91d0d608a2843942937533b3afb7faee53af591 Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Mon, 19 May 2014 17:51:14 +0800 Subject: [PATCH] GBE: fix one post register allocation instruction scheduling bug. The instuction has modFlag 1 indicating it will modify the flag. Signed-off-by: Zhigang Gong Reviewed-by: "Yang, Rong R" --- 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); } -- 2.7.4