[Beignet] [PATCH] Fix a compare immediate optimize error.
Yang Rong
rong.r.yang at intel.com
Thu Nov 14 19:40:30 PST 2013
When do LOADI/compare -> compare optimize, IMM src1 will using LOADI type,
but LOADI doesn't care unsigned or signed. Should use the compare type.
Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
backend/src/backend/gen_insn_selection.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/backend/src/backend/gen_insn_selection.cpp b/backend/src/backend/gen_insn_selection.cpp
index 5a6b9fd..335321a 100644
--- a/backend/src/backend/gen_insn_selection.cpp
+++ b/backend/src/backend/gen_insn_selection.cpp
@@ -2528,6 +2528,8 @@ namespace gbe
const auto &childInsn = cast<LoadImmInstruction>(dag1->insn);
src0 = sel.selReg(insn.getSrc(0), type);
src1 = getRegisterFromImmediate(childInsn.getImmediate());
+ if(src1.type != src0.type)
+ src1 = GenRegister::retype(src1, src0.type);
if (dag0) dag0->isRoot = 1;
} else {
src0 = sel.selReg(insn.getSrc(0), type);
--
1.8.1.2
More information about the Beignet
mailing list