Module Name: xsrc Committed By: joerg Date: Sun May 30 01:53:31 UTC 2021
Modified Files: xsrc/external/mit/MesaLib/dist/src/amd/common: ac_llvm_helper.cpp xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm: lp_bld_format_srgb.c lp_bld_init.c lp_bld_misc.cpp Log Message: Support LLVM 13, mostly from upstream. To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.2 \ xsrc/external/mit/MesaLib/dist/src/amd/common/ac_llvm_helper.cpp cvs rdiff -u -r1.1.1.2 -r1.2 \ xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c cvs rdiff -u -r1.1.1.4 -r1.2 \ xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_init.c \ xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: xsrc/external/mit/MesaLib/dist/src/amd/common/ac_llvm_helper.cpp diff -u xsrc/external/mit/MesaLib/dist/src/amd/common/ac_llvm_helper.cpp:1.1.1.2 xsrc/external/mit/MesaLib/dist/src/amd/common/ac_llvm_helper.cpp:1.2 --- xsrc/external/mit/MesaLib/dist/src/amd/common/ac_llvm_helper.cpp:1.1.1.2 Tue Sep 24 16:31:46 2019 +++ xsrc/external/mit/MesaLib/dist/src/amd/common/ac_llvm_helper.cpp Sun May 30 01:53:30 2021 @@ -34,6 +34,7 @@ #include "ac_llvm_build.h" #include <llvm-c/Core.h> +#include <llvm/ADT/SmallString.h> #include <llvm/Target/TargetMachine.h> #include <llvm/IR/IRBuilder.h> #include <llvm/Analysis/TargetLibraryInfo.h> @@ -129,9 +130,15 @@ struct ac_compiler_passes *ac_create_llv llvm::TargetMachine *TM = reinterpret_cast<llvm::TargetMachine*>(tm); +#if HAVE_LLVM < 0x900 if (TM->addPassesToEmitFile(p->passmgr, p->ostream, nullptr, llvm::TargetMachine::CGFT_ObjectFile)) { +#else + if (TM->addPassesToEmitFile(p->passmgr, p->ostream, + nullptr, + llvm::CGFT_ObjectFile)) { +#endif fprintf(stderr, "amd: TargetMachine can't emit a file of this type!\n"); delete p; return NULL; @@ -214,6 +221,9 @@ LLVMValueRef ac_build_atomic_rmw(struct unsigned SSID = llvm::unwrap(ctx->context)->getOrInsertSyncScopeID(sync_scope); return llvm::wrap(llvm::unwrap(ctx->builder)->CreateAtomicRMW( binop, llvm::unwrap(ptr), llvm::unwrap(val), +#if LLVM_VERSION_MAJOR >= 13 + llvm::MaybeAlign(0), +#endif llvm::AtomicOrdering::SequentiallyConsistent, SSID)); } @@ -223,6 +233,9 @@ LLVMValueRef ac_build_atomic_cmp_xchg(st unsigned SSID = llvm::unwrap(ctx->context)->getOrInsertSyncScopeID(sync_scope); return llvm::wrap(llvm::unwrap(ctx->builder)->CreateAtomicCmpXchg( llvm::unwrap(ptr), llvm::unwrap(cmp), llvm::unwrap(val), +#if LLVM_VERSION_MAJOR >= 13 + llvm::MaybeAlign(0), +#endif llvm::AtomicOrdering::SequentiallyConsistent, llvm::AtomicOrdering::SequentiallyConsistent, SSID)); } Index: xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c diff -u xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c:1.1.1.2 xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c:1.2 --- xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c:1.1.1.2 Sun Mar 10 03:42:46 2019 +++ xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c Sun May 30 01:53:30 2021 @@ -66,7 +66,7 @@ * @author Roland Scheidegger <srol...@vmware.com> */ - +#include <math.h> #include "util/u_debug.h" #include "lp_bld_type.h" Index: xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_init.c diff -u xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_init.c:1.1.1.4 xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_init.c:1.2 --- xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_init.c:1.1.1.4 Tue Sep 24 16:54:21 2019 +++ xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_init.c Sun May 30 01:53:30 2021 @@ -167,7 +167,9 @@ create_pass_manager(struct gallivm_state */ LLVMAddReassociatePass(gallivm->passmgr); LLVMAddPromoteMemoryToRegisterPass(gallivm->passmgr); +#if HAVE_LLVM < 0xd00 LLVMAddConstantPropagationPass(gallivm->passmgr); +#endif LLVMAddInstructionCombiningPass(gallivm->passmgr); LLVMAddGVNPass(gallivm->passmgr); } Index: xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp diff -u xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp:1.1.1.4 xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp:1.2 --- xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp:1.1.1.4 Tue Sep 24 16:54:24 2019 +++ xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp Sun May 30 01:53:30 2021 @@ -72,7 +72,7 @@ #include <llvm/Support/TargetSelect.h> -#if HAVE_LLVM >= 0x0305 +#if HAVE_LLVM >= 0x0305 && HAVE_LLVM < 0xa00 #include <llvm/IR/CallSite.h> #endif #include <llvm/IR/IRBuilder.h>