LGTM, thanks. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Zhigang Gong Sent: Tuesday, January 07, 2014 10:41 AM To: [email protected] Cc: Gong, Zhigang Subject: [Beignet] [PATCH] GBE: Fix a bug at constant GEP processing.
We need to initialize the offset to zero for each new operand. Signed-off-by: Zhigang Gong <[email protected]> --- backend/src/llvm/llvm_gen_backend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp index 18e6967..8130882 100644 --- a/backend/src/llvm/llvm_gen_backend.cpp +++ b/backend/src/llvm/llvm_gen_backend.cpp @@ -923,13 +923,13 @@ namespace gbe } else { uint32_t TypeIndex; uint32_t constantOffset = 0; - uint32_t offset = 0; // currently only GetElementPtr is handled GBE_ASSERT(ce->getOpcode() == Instruction::GetElementPtr); Value *pointer = ce->getOperand(0); CompositeType* CompTy = cast<CompositeType>(pointer->getType()); for(uint32_t op=1; op<ce->getNumOperands(); ++op) { + uint32_t offset = 0; ConstantInt* ConstOP = dyn_cast<ConstantInt>(ce->getOperand(op)); GBE_ASSERT(ConstOP); TypeIndex = ConstOP->getZExtValue(); -- 1.7.9.5 _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
