[Mesa-dev] [PATCH] radeonsi: use llvm.amdgcn.s.barrier instead of llvm.AMDGPU.barrier.local
Marek Olšák
maraeo at gmail.com
Tue Jan 26 03:55:06 PST 2016
On Mon, Jan 25, 2016 at 10:49 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> The new name for the intrinsic was introduced in LLVM r258558.
> ---
> src/gallium/drivers/radeonsi/si_shader.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
> index c365b14..0723693 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -3465,7 +3465,12 @@ static void si_llvm_emit_barrier(const struct lp_build_tgsi_action *action,
> {
> struct gallivm_state *gallivm = bld_base->base.gallivm;
>
> - lp_build_intrinsic(gallivm->builder, "llvm.AMDGPU.barrier.local",
> + lp_build_intrinsic(gallivm->builder,
> +#if HAVE_LLVM >= 0x0309
> + "llvm.amdgcn.s.barrier",
> +#else
> + "llvm.AMDGPU.barrier.local",
> +#endif
My preference is not to use the preprocessor when we don't have to.
HAVE_LLVM is a constant, so:
HAVE_LLVM >= 0x0309 ? "llvm.amdgcn.s.barrier" : "llvm.AMDGPU.barrier.local"
With that done:
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
More information about the mesa-dev
mailing list