[Beignet] [PATCH 1/2] GBE: prepare to optimize generic selection vector allocation.

Gong, Zhigang zhigang.gong at intel.com
Sun Feb 23 20:24:31 PST 2014


Right. After the liveness interval calculation, the instruction id will not be changed. As we need to maintain each selection vector's instruction's
ID. If we change the instruction ID each time when we insert a MOV instruction, then all the selection vector's instruction ID need to be updated
which is very ineffieicnt. So I choose to not change those instruction ID even when we inserted some new MOVs. This way, all the liveness interval
data is still valid no mather when or where we inserted some MOVs.

And I don't see any big side effect. Do you see any other side effect of this solution?

> -----Original Message-----
> From: Song, Ruiling
> Sent: Monday, February 24, 2014 12:15 PM
> To: Yang, Rong R; Gong, Zhigang; beignet at lists.freedesktop.org
> Cc: Gong, Zhigang
> Subject: RE: [Beignet] [PATCH 1/2] GBE: prepare to optimize generic selection
> vector allocation.
> 
> [Ruiling]: I also got a surprise at first, but seems that all the insn->ID does not
> consider the new inserted MOVs. So the register intervals still aligned among
> the registers. I am not sure if there are some side effect, but at least I do not
> see any.
> 
> diff --git a/backend/src/backend/gen_reg_allocation.cpp
> b/backend/src/backend/gen_reg_allocation.cpp
> index 8243f19..4e276c3 100644
> --- a/backend/src/backend/gen_reg_allocation.cpp
> +++ b/backend/src/backend/gen_reg_allocation.cpp
> @@ -292,6 +292,10 @@ namespace gbe
>            tmp = selection.replaceDst(vector->insn, regID);
>          const VectorLocation location = std::make_pair(vector, regID);
>          this->vectorMap.insert(std::make_pair(tmp, location));
> +        intervals.push_back(tmp);
> +        intervals[tmp].minID = vector->insn->ID;
> +        intervals[tmp].maxID = vector->insn->ID;
> >>>>>>>>The tmp is dst of mov before vector->insn, so minID should be insn - 1?
> And if there are some instructions are inserted, so vector->insn->ID is also
> change, isn't it?
> 
> 
> 
> 



More information about the Beignet mailing list