[Beignet] [PATCH 1/5] GBE: refine Phi copy interfering check.

Song, Ruiling ruiling.song at intel.com
Sun Sep 20 19:52:34 PDT 2015


Yes, this is a good fix. LGTM.

Thanks!
Ruiling

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Zhigang Gong
> Sent: Tuesday, September 1, 2015 12:05 PM
> To: beignet at lists.freedesktop.org
> 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 <zhigang.gong at intel.com>
> ---
>  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
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list