[Beignet] [PATCH] GBE: Don't use TYPE_S32 as point type directly.
Yang Rong
rong.r.yang at intel.com
Mon Nov 16 18:05:52 PST 2015
Use getType instead.
Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
backend/src/llvm/llvm_gen_backend.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index 858bd49..4cf160f 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -2553,13 +2553,13 @@ namespace gbe
this->newRegister(const_cast<GlobalVariable*>(&v));
ir::Register reg = regTranslator.getScalar(const_cast<GlobalVariable*>(&v), 0);
- ctx.LOADI(ir::TYPE_S32, reg, ctx.newIntegerImmediate(oldSlm + padding/8, ir::TYPE_S32));
+ ctx.LOADI(getType(ctx, v.getType()), reg, ctx.newIntegerImmediate(oldSlm + padding/8, getType(ctx, v.getType())));
} else if(addrSpace == ir::MEM_CONSTANT || v.isConstant()) {
GBE_ASSERT(v.hasInitializer());
this->newRegister(const_cast<GlobalVariable*>(&v));
ir::Register reg = regTranslator.getScalar(const_cast<GlobalVariable*>(&v), 0);
ir::Constant &con = unit.getConstantSet().getConstant(v.getName());
- ctx.LOADI(ir::TYPE_S32, reg, ctx.newIntegerImmediate(con.getOffset(), ir::TYPE_S32));
+ ctx.LOADI(getType(ctx, v.getType()), reg, ctx.newIntegerImmediate(con.getOffset(), getType(ctx, v.getType())));
} else {
if(v.getName().equals(StringRef("__gen_ocl_printf_buf"))) {
ctx.getFunction().getPrintfSet()->setBufBTI(BtiMap.find(const_cast<GlobalVariable*>(&v))->second);
@@ -4575,7 +4575,7 @@ namespace gbe
// but later ArgumentLower pass need to match exact load/addImm pattern
// so, I avoid subtracting zero base to satisfy ArgumentLower pass.
if (!zeroBase)
- ctx.SUB(ir::TYPE_U32, mPtr, pointer, baseReg);
+ ctx.SUB(getType(ctx, llvmPtr->getType()), mPtr, pointer, baseReg);
else
mPtr = pointer;
} else {
--
2.1.4
More information about the Beignet
mailing list