[Beignet] [PATCH v2 1/2] fix the error that structure would be pushed twice

Zhigang Gong zhigang.gong at linux.intel.com
Tue Nov 5 20:04:57 PST 2013


Pushed, thanks.

On Tue, Nov 05, 2013 at 01:55:23PM +0800, Lu Guanqun wrote:
> From: Yang Rong <rong.r.yang at intel.com>
> 
> Signed-off-by: Yang Rong <rong.r.yang at intel.com>
> Tested-by: Lu Guanqun <guanqun.lu at intel.com>
> Reviewed-by: Lu Guanqun <guanqun.lu at intel.com>
> ---
>  backend/src/ir/lowering.cpp |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/backend/src/ir/lowering.cpp b/backend/src/ir/lowering.cpp
> index 6cccaf5..013878c 100644
> --- a/backend/src/ir/lowering.cpp
> +++ b/backend/src/ir/lowering.cpp
> @@ -233,8 +233,14 @@ namespace ir {
>          const PushLocation argLocation(*fn, loadAddImm.argID, offset);
>          if (inserted.contains(argLocation))
>            continue;
> +        Register pushed;
>          const Register reg = load->getValue(valueID);
> -        const Register pushed = fn->newRegister(family);
> +        if (offset != 0) {
> +            pushed = fn->newRegister(family);
> +            this->appendPushedConstant(pushed, argLocation);
> +        } else {
> +            pushed = fn->getArg(loadAddImm.argID).reg;
> +        }
>  
>          // TODO the MOV instruction can be most of the time avoided if the
>          // register is never written. We must however support the register
> @@ -243,7 +249,6 @@ namespace ir {
>          const Instruction mov = ir::MOV(type, reg, pushed);
>          mov.replace(load);
>          dead.insert(load);
> -        this->appendPushedConstant(pushed, argLocation);
>        }
>      }
>  
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list