[Mesa-dev] [PATCH] radeon/llvm: Handle LLVM backend rename from R600 to AMDGPU
Marek Olšák
maraeo at gmail.com
Fri Jun 12 02:27:19 PDT 2015
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Fri, Jun 12, 2015 at 2:36 AM, Tom Stellard <thomas.stellard at amd.com> wrote:
> ---
> configure.ac | 13 ++++++++-----
> src/gallium/drivers/radeon/radeon_llvm_emit.c | 8 ++++++++
> 2 files changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index d32aa24..eda8d23 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2048,16 +2048,19 @@ require_egl_drm() {
> }
>
> radeon_llvm_check() {
> + if test ${LLVM_VERSION_INT} -lt 307; then
> + amdgpu_llvm_target_name='r600'
> + else
> + amdgpu_llvm_target_name='amdgpu'
> + fi
> if test "x$enable_gallium_llvm" != "xyes"; then
> AC_MSG_ERROR([--enable-gallium-llvm is required when building $1])
> fi
> llvm_check_version_for "3" "4" "2" $1
> - if test true && $LLVM_CONFIG --targets-built | grep -qvw 'R600' ; then
> - AC_MSG_ERROR([LLVM R600 Target not enabled. You can enable it when building the LLVM
> - sources with the --enable-experimental-targets=R600
> - configure flag])
> + if test true && $LLVM_CONFIG --targets-built | grep -iqvw $amdgpu_llvm_target_name ; then
> + AC_MSG_ERROR([LLVM $amdgpu_llvm_target_name not enabled in your LLVM build.])
> fi
> - LLVM_COMPONENTS="${LLVM_COMPONENTS} r600 bitreader ipo"
> + LLVM_COMPONENTS="${LLVM_COMPONENTS} $amdgpu_llvm_target_name bitreader ipo"
> NEED_RADEON_LLVM=yes
> if test "x$have_libelf" != xyes; then
> AC_MSG_ERROR([$1 requires libelf when using llvm])
> diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.c b/src/gallium/drivers/radeon/radeon_llvm_emit.c
> index 624077c..25580b6 100644
> --- a/src/gallium/drivers/radeon/radeon_llvm_emit.c
> +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.c
> @@ -86,10 +86,18 @@ static void init_r600_target()
> {
> static unsigned initialized = 0;
> if (!initialized) {
> +#if HAVE_LLVM < 0x0307
> LLVMInitializeR600TargetInfo();
> LLVMInitializeR600Target();
> LLVMInitializeR600TargetMC();
> LLVMInitializeR600AsmPrinter();
> +#else
> + LLVMInitializeAMDGPUTargetInfo();
> + LLVMInitializeAMDGPUTarget();
> + LLVMInitializeAMDGPUTargetMC();
> + LLVMInitializeAMDGPUAsmPrinter();
> +
> +#endif
> initialized = 1;
> }
> }
> --
> 2.0.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