[Beignet] [PATCH] GBE: Remove some noduplicate to let inline works

Zhigang Gong zhigang.gong at linux.intel.com
Tue Jan 7 22:54:50 PST 2014


LGTM, pushed, thanks.

On Wed, Jan 08, 2014 at 02:58:07PM +0800, Ruiling Song wrote:
> llvm Inliner seems won't inline a function if it contains noduplicate function calls.
> So, we just keep the noduplicate for barrier itself. then barrier() could still be inlined.
> 
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
>  backend/src/ocl_barrier.ll |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/backend/src/ocl_barrier.ll b/backend/src/ocl_barrier.ll
> index b493597..9f46347 100644
> --- a/backend/src/ocl_barrier.ll
> +++ b/backend/src/ocl_barrier.ll
> @@ -6,16 +6,16 @@
>  
>  declare i32 @_get_local_mem_fence() nounwind alwaysinline
>  declare i32 @_get_global_mem_fence() nounwind alwaysinline
> -declare void @__gen_ocl_barrier_local() nounwind noduplicate alwaysinline
> -declare void @__gen_ocl_barrier_global() nounwind noduplicate alwaysinline
> -declare void @__gen_ocl_barrier_local_and_global() nounwind noduplicate alwaysinline
> +declare void @__gen_ocl_barrier_local() nounwind alwaysinline
> +declare void @__gen_ocl_barrier_global() nounwind alwaysinline
> +declare void @__gen_ocl_barrier_local_and_global() nounwind alwaysinline
>  
>  define void @barrier(i32 %flags) nounwind noduplicate alwaysinline {
>    %1 = icmp eq i32 %flags, 3
>    br i1 %1, label %barrier_local_global, label %barrier_local_check
>  
>  barrier_local_global:
> -  call void @__gen_ocl_barrier_local_and_global() noduplicate
> +  call void @__gen_ocl_barrier_local_and_global()
>    br label %done
>  
>  barrier_local_check:
> @@ -23,7 +23,7 @@ barrier_local_check:
>    br i1 %2, label %barrier_local, label %barrier_global_check
>  
>  barrier_local:
> -  call void @__gen_ocl_barrier_local() noduplicate
> +  call void @__gen_ocl_barrier_local()
>    br label %done
>  
>  barrier_global_check:
> @@ -31,7 +31,7 @@ barrier_global_check:
>    br i1 %3, label %barrier_global, label %done
>  
>  barrier_global:
> -  call void @__gen_ocl_barrier_global() noduplicate
> +  call void @__gen_ocl_barrier_global()
>    br label %done
>  
>  done:
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list