[Mesa-dev] [PATCH 1/3] gallivm: Move LLVMStartMultithreaded() static initializer into gallivm

Jose Fonseca jfonseca at vmware.com
Fri May 3 07:28:07 PDT 2013


Looks ok by me.

----- Original Message -----
> From: Tom Stellard <thomas.stellard at amd.com>
> 
> This does not solve all of the problems with using LLVM in a
> multithreaded enivronment, but it should help in some cases.
> ---
>  src/gallium/auxiliary/gallivm/lp_bld_misc.cpp   | 15 +++++++++++++++
>  src/gallium/drivers/radeon/radeon_llvm_emit.cpp | 14 --------------
>  2 files changed, 15 insertions(+), 14 deletions(-)
> 
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> index 717afa7..1500602 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> @@ -77,6 +77,21 @@
>  
>  #include "lp_bld_misc.h"
>  
> +namespace {
> +
> +class LLVMEnsureMultithreaded {
> +public:
> +   LLVMEnsureMultithreaded()
> +   {
> +      if (!LLVMIsMultithreaded()) {
> +         LLVMStartMultithreaded();
> +      }
> +   }
> +};
> +
> +static LLVMEnsureMultithreaded lLVMEnsureMultithreaded;
> +
> +}
>  
>  extern "C" void
>  lp_set_target_options(void)
> diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
> b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
> index 55dad9b..03eb5f2 100644
> --- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
> +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
> @@ -58,20 +58,6 @@
>  
>  using namespace llvm;
>  
> -namespace {
> -
> -class LLVMEnsureMultithreaded {
> -public:
> -   LLVMEnsureMultithreaded()
> -   {
> -      llvm_start_multithreaded();
> -   }
> -};
> -
> -static LLVMEnsureMultithreaded lLVMEnsureMultithreaded;
> -
> -}
> -
>  /**
>   * Set the shader type we want to compile
>   *
> --
> 1.7.11.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 


More information about the mesa-dev mailing list