[Beignet] [PATCH 1/2] GBE: fix caffe fft tests fail.

Yang Rong rong.r.yang at intel.com
Mon Jun 20 16:15:28 UTC 2016


When check isRoot, one of instruction's dst is liveout, must set this
insn to root.
for example:
LOAD.float.global.aligned {%86 %106} %212 bti:2
if %106 is block's liveout, must set it to root, otherwise the insn may
be deleted.

This patch could fix caffe fft tests:
./test/test.testbin --gtest_filter=*FFT*

Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
 backend/src/backend/gen_insn_selection.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/backend/src/backend/gen_insn_selection.cpp b/backend/src/backend/gen_insn_selection.cpp
index d7190a0..398576f 100644
--- a/backend/src/backend/gen_insn_selection.cpp
+++ b/backend/src/backend/gen_insn_selection.cpp
@@ -2143,9 +2143,11 @@ namespace gbe
     const ir::BasicBlock *insnBlock = insn.getParent();
     const ir::Liveness &liveness = this->ctx.getLiveness();
     const ir::Liveness::LiveOut &liveOut = liveness.getLiveOut(insnBlock);
-    const ir::Register reg = insn.getDst(0);
-    if (liveOut.contains(reg))
-      return true;
+    for(uint32_t i = 0; i < insn.getDstNum(); i++) {
+      const ir::Register reg = insn.getDst(i);
+      if (liveOut.contains(reg))
+        return true;
+    }
 
     // The instruction is only used in the current basic block
     return false;
-- 
2.1.4



More information about the Beignet mailing list