[Beignet] [PATCH 2/2] GBE: fixed a potential scalarize bug.

Song, Ruiling ruiling.song at intel.com
Sun Apr 27 18:45:01 PDT 2014


Yes, it is fixed by the patch.

-----Original Message-----
From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Zhigang Gong
Sent: Monday, April 28, 2014 8:52 AM
To: Gong, Zhigang
Cc: beignet at lists.freedesktop.org
Subject: Re: [Beignet] [PATCH 2/2] GBE: fixed a potential scalarize bug.

Ruiling, could you verify whether this patch fix the regression you found.
Thanks.

On Thu, Apr 24, 2014 at 06:18:40PM +0800, Zhigang Gong wrote:
> We need to append extract instruction when do a bitcast to a vector. 
> Otherwise, we may trigger an assert as the extract instruction uses a 
> undefined vector.
> 
> After this patch, it becomes safe to do many rounds of scalarize pass.
> 
> Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
> ---
>  backend/src/llvm/llvm_scalarize.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/backend/src/llvm/llvm_scalarize.cpp 
> b/backend/src/llvm/llvm_scalarize.cpp
> index 911be30..73817e2 100644
> --- a/backend/src/llvm/llvm_scalarize.cpp
> +++ b/backend/src/llvm/llvm_scalarize.cpp
> @@ -683,8 +683,10 @@ namespace gbe {
>    {
>      if(bt->getOperand(0)->getType()->isVectorTy())
>        bt->setOperand(0, InsertToVector(bt, bt->getOperand(0)));
> -    if(bt->getType()->isVectorTy())
> +    if(bt->getType()->isVectorTy()) {
> +      setAppendPoint(bt);
>        extractFromVector(bt);
> +    }
>      return false;
>    }
>  
> --
> 1.8.3.2
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list