[Beignet] [PATCH] GBE: remove constant expression handling code in gen writer pass.
Song, Ruiling
ruiling.song at intel.com
Thu Feb 26 23:11:16 PST 2015
> 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.
> - 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