[Beignet] [PATCH] GBE: remove constant expression handling code in gen writer pass.
Song, Ruiling
ruiling.song at intel.com
Thu Feb 26 23:20:34 PST 2015
> -----Original Message-----
> From: Gong, Zhigang
> Sent: Friday, February 27, 2015 3:13 PM
> To: Song, Ruiling; beignet at lists.freedesktop.org
> Subject: RE: [Beignet] [PATCH] GBE: remove constant expression handling
> code in gen writer pass.
>
>
>
> > -----Original Message-----
> > From: Song, Ruiling
> > Sent: Friday, February 27, 2015 3:11 PM
> > To: Gong, Zhigang; beignet at lists.freedesktop.org
> > Cc: Gong, Zhigang
> > Subject: RE: [Beignet] [PATCH] GBE: remove constant expression
> > handling code in gen writer pass.
> >
> > > ir::Register GenWriter::getConstantRegister(Constant *c, uint32_t
> > > elemID) {
> > > GBE_ASSERT(c != NULL);
> > > if(isa<GlobalValue>(c)) {
> > > @@ -1309,15 +1106,6 @@ error:
> > > return reg;
> > > }
> > >
> > What about put an assert check here?
> > GBE_ASSERT(!isa<ConstantExpr>(c));
> > Other parts looks good to me.
> There is an assert in the coming newImmediate(), so I think we don’t need
> to add an extra assert here.
I see. It looks good.
>
> Thanks,
> Zhigang Gong.
>
> >
> > > - if(isa<ConstantExpr>(c)) {
> > > - // Check whether this is a constant drived from a pointer.
> > > - Constant *itC = c;
> > > - while(isa<ConstantExpr>(itC))
> > > - itC = dyn_cast<ConstantExpr>(itC)->getOperand(0);
> > > - if (itC->getType()->isPointerTy())
> > > - return
> getConstantPointerRegister(dyn_cast<ConstantExpr>(c),
> > > elemID);
> > > - }
> > > -
> > > const ir::ImmediateIndex immIndex = this->newImmediate(c,
> elemID);
> > > const ir::Immediate imm = ctx.getImmediate(immIndex);
> > > const ir::Register reg = ctx.reg(getFamily(imm.getType()));
> > > --
> > > 1.9.1
> > >
> > > _______________________________________________
> > > Beignet mailing list
> > > Beignet at lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list