[Beignet] [PATCH 1/2] Fix a re-schedule issue of scratch write

Ruiling Song ruiling.song at intel.com
Thu Aug 8 22:23:40 PDT 2013


As scratchMsgHeader+1 will be re-used as scratch write payload.
So, scratchMsgHeader+1 will be first spilled out.
Add the scratch write dependency to keep scratch write in order.
this fix a failure(compiler_box_blur_float) when spilling.

Signed-off-by: Ruiling Song <ruiling.song at intel.com>
---
 backend/src/backend/gen_insn_scheduling.cpp |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/backend/src/backend/gen_insn_scheduling.cpp b/backend/src/backend/gen_insn_scheduling.cpp
index 0b720b7..2e0f175 100644
--- a/backend/src/backend/gen_insn_scheduling.cpp
+++ b/backend/src/backend/gen_insn_scheduling.cpp
@@ -467,6 +467,11 @@ namespace gbe
         tracker.addDependency(node, index);
       }
 
+      // write-after-write in scratch memory
+      if (insn.opcode == SEL_OP_SPILL_REG) {
+        const uint32_t index = tracker.getIndex(0xff);
+        tracker.addDependency(node, index);
+      }
 
       // Consider barriers and wait are writing memory (local and global)
     if (insn.opcode == SEL_OP_BARRIER ||
-- 
1.7.9.5



More information about the Beignet mailing list