[Mesa-dev] [PATCH] gallivm: limit use of setFastMathFlags to LLVM 3.8 and later

Brian Paul brianp at vmware.com
Tue Nov 15 19:00:41 UTC 2016


On 11/15/2016 11:56 AM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> ---
>   src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> index da3cbdd..a68428d 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> @@ -732,18 +732,20 @@ lp_is_function(LLVMValueRef v)
>   #else
>   	return llvm::isa<llvm::Function>(llvm::unwrap(v));
>   #endif
>   }
>
>   extern "C" LLVMBuilderRef
>   lp_create_builder(LLVMContextRef ctx, bool unsafe_fpmath)
>   {
>      LLVMBuilderRef builder = LLVMCreateBuilderInContext(ctx);
>
> +#if HAVE_LLVM >= 0x0308
>      if (unsafe_fpmath) {
>         llvm::FastMathFlags flags;
>         flags.setUnsafeAlgebra();
>         llvm::unwrap(builder)->setFastMathFlags(flags);
>      }
> +#endif
>
>      return builder;
>   }
>

Reviewed-by: Brian Paul <brianp at vmware.com>

Thanks!



More information about the mesa-dev mailing list