LGTM, will push latter, thanks.
On Thu, Jan 29, 2015 at 10:36:40AM +0800, Ruiling Song wrote: > Signed-off-by: Ruiling Song <[email protected]> > --- > backend/src/llvm/llvm_passes.cpp | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/backend/src/llvm/llvm_passes.cpp > b/backend/src/llvm/llvm_passes.cpp > index d315d53..5c0a2e0 100644 > --- a/backend/src/llvm/llvm_passes.cpp > +++ b/backend/src/llvm/llvm_passes.cpp > @@ -355,14 +355,16 @@ namespace gbe > CompTy = dyn_cast<CompositeType>(CompTy->getTypeAtIndex(TypeIndex)); > } > > - //insert addition of new offset before GEPInst > - Constant* newConstOffset = > - ConstantInt::get(IntegerType::get(GEPInst->getContext(), > - ptrSize), > - constantOffset); > - currentAddrInst = > - BinaryOperator::Create(Instruction::Add, currentAddrInst, > - newConstOffset, "", GEPInst); > + //insert addition of new offset before GEPInst when it is not zero > + if (constantOffset != 0) { > + Constant* newConstOffset = > + ConstantInt::get(IntegerType::get(GEPInst->getContext(), > + ptrSize), > + constantOffset); > + currentAddrInst = > + BinaryOperator::Create(Instruction::Add, currentAddrInst, > + newConstOffset, "", GEPInst); > + } > > //convert offset to ptr type (nop) > IntToPtrInst* intToPtrInst = > -- > 1.7.10.4 > > _______________________________________________ > Beignet mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
