[Mesa-stable] [Mesa-dev] [PATCH] swr: [rasterizer jitter] fix llvm >= 7 build break
Eric Engestrom
eric.engestrom at intel.com
Thu Sep 20 19:43:33 UTC 2018
On Thursday, 2018-09-20 14:22:05 -0400, Chuck Atkins wrote:
> Signed-off-by: Chuck Atkins <chuck.atkins at kitware.com>
> CC: <mesa-stable at lists.freedesktop.org>
> CC: Bruce Cherniak <bruce.cherniak at intel.com>
> CC: George Kyriazis <george.kyriazis at intel.com>
> CC: Tim Rowley <timothy.o.rowley at intel.com>
> ---
> configure.ac | 7 ++++++-
> src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp | 4 ++++
> src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp | 4 ++++
> .../drivers/swr/rasterizer/jitter/functionpasses/lower_x86.cpp | 4 ++++
> src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp | 1 +
> src/gallium/drivers/swr/rasterizer/jitter/streamout_jit.cpp | 6 +++++-
> 6 files changed, 24 insertions(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 864dcae8e3..9a47ca4797 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1010,7 +1010,7 @@ if test "x$have_libelf" = xno; then
> AC_SUBST([LIBELF_CFLAGS])
> fi
>
> -if test -z "$LLVM_CONFIG"; then
> +if test -z "$LLM_CONFIG"; then
Just a fly by notice; make sure to revert this before pushing :)
> if test -n "$llvm_prefix"; then
> AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
> else
> @@ -2719,6 +2719,11 @@ if test -n "$with_gallium_drivers"; then
> ;;
> xswr)
> llvm_require_version $LLVM_REQUIRED_SWR "swr"
> + llvm_add_default_components "swr"
> + if test $LLVM_VERSION_MAJOR -ge 7; then
> + llvm_add_component "ipo" "swr"
> + llvm_add_component "ObjCARCOpts" "swr"
> + fi
>
> if test "x$HAVE_CXX11" != "xyes"; then
> AC_MSG_ERROR([swr requires c++11 support])
> diff --git a/src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp b/src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp
> index f89c502db7..1d6fb405dd 100644
> --- a/src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp
> +++ b/src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp
> @@ -870,7 +870,11 @@ struct BlendJit : public Builder
> passes.add(createCFGSimplificationPass());
> passes.add(createEarlyCSEPass());
> passes.add(createInstructionCombiningPass());
> +#if LLVM_VERSION_MAJOR >= 7
> + passes.add(createInstSimplifyLegacyPass());
> +#else
> passes.add(createInstructionSimplifierPass());
> +#endif
> passes.add(createConstantPropagationPass());
> passes.add(createSCCPPass());
> passes.add(createAggressiveDCEPass());
> diff --git a/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp b/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
> index b4d326ebdc..26972cddc2 100644
> --- a/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
> +++ b/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
> @@ -294,7 +294,11 @@ Function* FetchJit::Create(const FETCH_COMPILE_STATE& fetchState)
> optPasses.add(createCFGSimplificationPass());
> optPasses.add(createEarlyCSEPass());
> optPasses.add(createInstructionCombiningPass());
> +#if LLVM_VERSION_MAJOR >= 7
> + optPasses.add(createInstSimplifyLegacyPass());
> +#else
> optPasses.add(createInstructionSimplifierPass());
> +#endif
> optPasses.add(createConstantPropagationPass());
> optPasses.add(createSCCPPass());
> optPasses.add(createAggressiveDCEPass());
> diff --git a/src/gallium/drivers/swr/rasterizer/jitter/functionpasses/lower_x86.cpp b/src/gallium/drivers/swr/rasterizer/jitter/functionpasses/lower_x86.cpp
> index 7605823c04..c58a7552a3 100644
> --- a/src/gallium/drivers/swr/rasterizer/jitter/functionpasses/lower_x86.cpp
> +++ b/src/gallium/drivers/swr/rasterizer/jitter/functionpasses/lower_x86.cpp
> @@ -76,7 +76,11 @@ namespace SwrJit
> {"meta.intrinsic.VCVTPS2PH", Intrinsic::x86_vcvtps2ph_256},
> {"meta.intrinsic.VPTESTC", Intrinsic::x86_avx_ptestc_256},
> {"meta.intrinsic.VPTESTZ", Intrinsic::x86_avx_ptestz_256},
> +#if LLVM_VERSION_MAJOR >= 7
> + {"meta.intrinsic.VFMADDPS", Intrinsic::fma},
> +#else
> {"meta.intrinsic.VFMADDPS", Intrinsic::x86_fma_vfmadd_ps_256},
> +#endif
> {"meta.intrinsic.VPHADDD", Intrinsic::x86_avx2_phadd_d},
> {"meta.intrinsic.PDEP32", Intrinsic::x86_bmi_pdep_32},
> {"meta.intrinsic.RDTSC", Intrinsic::x86_rdtsc},
> diff --git a/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp b/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp
> index 47f717bfc2..e58de783ab 100644
> --- a/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp
> +++ b/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp
> @@ -70,6 +70,7 @@ using PassManager = llvm::legacy::PassManager;
> #if LLVM_VERSION_MAJOR >= 7
> #include "llvm/Transforms/Utils.h"
> #include "llvm/Transforms/InstCombine/InstCombine.h"
> +#include "llvm/LinkAllPasses.h"
> #endif
> #include "llvm/Support/Host.h"
> #include "llvm/Support/DynamicLibrary.h"
> diff --git a/src/gallium/drivers/swr/rasterizer/jitter/streamout_jit.cpp b/src/gallium/drivers/swr/rasterizer/jitter/streamout_jit.cpp
> index 8f86af2a4b..1b78c8296e 100644
> --- a/src/gallium/drivers/swr/rasterizer/jitter/streamout_jit.cpp
> +++ b/src/gallium/drivers/swr/rasterizer/jitter/streamout_jit.cpp
> @@ -306,7 +306,11 @@ struct StreamOutJit : public Builder
> passes.add(createCFGSimplificationPass());
> passes.add(createEarlyCSEPass());
> passes.add(createInstructionCombiningPass());
> - passes.add(createInstructionSimplifierPass());
> +#if LLVM_VERSION_MAJOR >= 7
> + passes.add(createInstSimplifyLegacyPass());
> +#else
> + passes.add(createInstructionSimplifierPass());
> +#endif
> passes.add(createConstantPropagationPass());
> passes.add(createSCCPPass());
> passes.add(createAggressiveDCEPass());
> --
> 2.12.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-stable
mailing list