[Beignet] [PATCH 2/2] GBE: fixed a potential scalarize bug.
Zhigang Gong
zhigang.gong at linux.intel.com
Sun Apr 27 17:52:18 PDT 2014
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
More information about the Beignet
mailing list