From: Junyan He Date: Wed, 22 Jan 2014 06:02:30 +0000 (+0800) Subject: Fix the bug in removeLOADIs function. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84459335c59a023baa5513cb091e775b75b5c0c0;p=contrib%2Fbeignet.git Fix the bug in removeLOADIs function. The logic for replacing the dst of the instruction using the src number and getSrc. Fix this problem. Signed-off-by: Junyan He Reviewed-by: Yang Rong Reviewed-by: Zhigang Gong --- diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp index 6d61f90..c6948da 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);