[Beignet] [PATCH] GBE: fix a assert when structure argument's first field don't used.

Yang, Rong R rong.r.yang at intel.com
Wed Dec 23 00:26:37 PST 2015


Ping for review.

> -----Original Message-----
> From: Yang, Rong R
> Sent: Friday, November 27, 2015 12:20
> To: beignet at lists.freedesktop.org
> Cc: Yang, Rong R
> Subject: [PATCH] GBE: fix a assert when structure argument's first field don't
> used.
> 
> If use stucture argument's other field but don't use first field, the argument's
> curbe payload will not be allocated, cause assert.
> Set the maxID to 1 for this case, because each filed deallocate separately.
> 
> Signed-off-by: Yang Rong <rong.r.yang at intel.com>
> ---
>  backend/src/backend/gen_reg_allocation.cpp | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/backend/src/backend/gen_reg_allocation.cpp
> b/backend/src/backend/gen_reg_allocation.cpp
> index cd819d1..633d741 100644
> --- a/backend/src/backend/gen_reg_allocation.cpp
> +++ b/backend/src/backend/gen_reg_allocation.cpp
> @@ -1050,6 +1050,7 @@ namespace gbe
> 
>    INLINE bool GenRegAllocator::Opaque::allocate(Selection &selection) {
>      using namespace ir;
> +    const Function::PushMap &pushMap = ctx.fn.getPushMap();
> 
>      if (ctx.reservedSpillRegs != 0) {
>        reservedReg = ctx.allocate(ctx.reservedSpillRegs * GEN_REG_SIZE,
> GEN_REG_SIZE, false); @@ -1174,6 +1175,15 @@ namespace gbe
>          delete boolsMap;
>      }
> 
> +    for (auto &it : this->intervals) {
> +      if (it.maxID == -INT_MAX)  continue;
> +      if(pushMap.find(it.reg) != pushMap.end()) {
> +        uint32_t argID = ctx.fn.getPushLocation(it.reg)->argID;
> +        ir::Register argReg = ctx.fn.getArg(argID).reg;
> +        intervals[argReg].maxID = std::max(intervals[argReg].maxID, 1);
> +      }
> +    }
> +
>      if (ctx.inProfilingMode) {
>        /* If we are in profiling mode, we always need xyz dim info and
> timestamp curbes.
>           xyz dim info related curbe registers just live for the first INSN, but
> timestamp
> --
> 2.1.4



More information about the Beignet mailing list