[Beignet] [PATCH] Fix the bug in removeLOADIs function.

junyan.he at inbox.com junyan.he at inbox.com
Tue Jan 21 22:02:30 PST 2014


From: Junyan He <junyan.he at linux.intel.com>

The logic for replacing the dst of the instruction
using the src number and getSrc. Fix this problem.

Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
 backend/src/llvm/llvm_gen_backend.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index c468b02..4bfd8af 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -1355,7 +1355,7 @@ namespace gbe
         // substitutions (if any)
         else {
           const uint32_t srcNum = insn.getSrcNum();
-          const uint32_t dstNum = insn.getSrcNum();
+          const uint32_t dstNum = insn.getDstNum();
           for (uint32_t srcID = 0; srcID < srcNum; ++srcID) {
             const ir::Register src = insn.getSrc(srcID);
             auto it = immTranslate.find(src);
@@ -1363,7 +1363,7 @@ namespace gbe
               insn.setSrc(srcID, it->second);
           }
           for (uint32_t dstID = 0; dstID < dstNum; ++dstID) {
-            const ir::Register dst = insn.getSrc(dstID);
+            const ir::Register dst = insn.getDst(dstID);
             auto it = immTranslate.find(dst);
             if (it != immTranslate.end())
               insn.setDst(dstID, it->second);
-- 
1.7.9.5



More information about the Beignet mailing list