Yes, this is a good fix. LGTM.

Thanks!
Ruiling

> -----Original Message-----
> From: Beignet [mailto:[email protected]] On Behalf Of
> Zhigang Gong
> Sent: Tuesday, September 1, 2015 12:05 PM
> To: [email protected]
> Cc: Gong, Zhigang
> Subject: [Beignet] [PATCH 1/5] GBE: refine Phi copy interfering check.
> 
> If the PHI source register's definition instruction uses the phi register, it 
> is not a
> interfere. For an example:
> 
> MOV %phi, %phicopy
> ...
> ADD %phiSrcDef, %phi, tmp
> ...
> MOV %phicopy, %phiSrcDef
> ...
> 
> The %phi and the %phiSrcDef is not interering each other.
> Simply advancing the start of the check to next instruction is enough to get
> better result. For some special case, this patch could get significant 
> performance
> boost.
> 
> Signed-off-by: Zhigang Gong <[email protected]>
> ---
>  backend/src/llvm/llvm_gen_backend.cpp | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/backend/src/llvm/llvm_gen_backend.cpp
> b/backend/src/llvm/llvm_gen_backend.cpp
> index 4905415..38c63ce 100644
> --- a/backend/src/llvm/llvm_gen_backend.cpp
> +++ b/backend/src/llvm/llvm_gen_backend.cpp
> @@ -2220,6 +2220,8 @@ namespace gbe
> 
>              ir::BasicBlock::const_iterator iter =
> ir::BasicBlock::const_iterator(phiCopySrcDefInsn);
>              ir::BasicBlock::const_iterator iterE = bb->end();
> +
> +            iter++;
>              // check no use of phi in this basicblock between [phiCopySrc 
> def, bb end]
>              bool phiPhiCopySrcInterfere = false;
>              while (iter != iterE) {
> --
> 1.9.1
> 
> _______________________________________________
> Beignet mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/beignet
_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to