[Mesa-dev] [PATCH] clover: Fix compiling with LLVM >= r315871

Dieter Nützel Dieter at nuetzel-hh.de
Mon Oct 16 22:55:35 UTC 2017


Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>

on RX580

Thanks,
Dieter

Am 16.10.2017 18:48, schrieb Vedran Miletić:
> ---
>  src/gallium/state_trackers/clover/llvm/codegen/common.cpp | 5 +++--
>  src/gallium/state_trackers/clover/llvm/compat.hpp         | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> index 075183400a..8bb9e0e47a 100644
> --- a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> @@ -128,8 +128,9 @@ namespace {
>                 const unsigned address_space =
>                    cast< 
> ::llvm::PointerType>(actual_type)->getAddressSpace();
> 
> -               if (address_space == 
> address_spaces[clang::LangAS::opencl_local
> -                                                   - 
> compat::lang_as_offset]) {
> +               if (address_space == address_spaces[
> +                   static_cast<unsigned>(clang::LangAS::opencl_local) 
> -
> +                   static_cast<unsigned>(compat::lang_as_offset)]) {
>                    args.emplace_back(module::argument::local, 
> arg_api_size,
>                                      target_size, target_align,
>                                      module::argument::zero_ext);
> diff --git a/src/gallium/state_trackers/clover/llvm/compat.hpp
> b/src/gallium/state_trackers/clover/llvm/compat.hpp
> index f8b56516d5..ef173ea56f 100644
> --- a/src/gallium/state_trackers/clover/llvm/compat.hpp
> +++ b/src/gallium/state_trackers/clover/llvm/compat.hpp
> @@ -70,7 +70,7 @@ namespace clover {
>  #endif
> 
>  #if HAVE_LLVM >= 0x0500
> -         const auto lang_as_offset = 0;
> +         const auto lang_as_offset = clang::LangAS::Default;
>           const clang::InputKind ik_opencl = clang::InputKind::OpenCL;
>  #else
>           const auto lang_as_offset = clang::LangAS::Offset;


More information about the mesa-dev mailing list