Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[xsrc/trunk]: xsrc/external/mit/MesaLib/dist/src Support LLVM 13, mostly from...
details: https://anonhg.NetBSD.org/xsrc/rev/c5398bbde6ed
branches: trunk
changeset: 10732:c5398bbde6ed
user: joerg <joerg%NetBSD.org@localhost>
date: Sun May 30 01:53:30 2021 +0000
description:
Support LLVM 13, mostly from upstream.
diffstat:
external/mit/MesaLib/dist/src/amd/common/ac_llvm_helper.cpp | 13 ++++++++++
external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c | 2 +-
external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_init.c | 2 +
external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 2 +-
4 files changed, 17 insertions(+), 2 deletions(-)
diffs (84 lines):
diff -r 61d2f091ed91 -r c5398bbde6ed external/mit/MesaLib/dist/src/amd/common/ac_llvm_helper.cpp
--- a/external/mit/MesaLib/dist/src/amd/common/ac_llvm_helper.cpp Thu May 27 20:20:43 2021 +0000
+++ b/external/mit/MesaLib/dist/src/amd/common/ac_llvm_helper.cpp Sun May 30 01:53:30 2021 +0000
@@ -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 @@
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 @@
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 @@
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));
}
diff -r 61d2f091ed91 -r c5398bbde6ed external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c
--- a/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c Thu May 27 20:20:43 2021 +0000
+++ b/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c Sun May 30 01:53:30 2021 +0000
@@ -66,7 +66,7 @@
* @author Roland Scheidegger <sroland%vmware.com@localhost>
*/
-
+#include <math.h>
#include "util/u_debug.h"
#include "lp_bld_type.h"
diff -r 61d2f091ed91 -r c5398bbde6ed external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_init.c
--- a/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_init.c Thu May 27 20:20:43 2021 +0000
+++ b/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_init.c Sun May 30 01:53:30 2021 +0000
@@ -167,7 +167,9 @@
*/
LLVMAddReassociatePass(gallivm->passmgr);
LLVMAddPromoteMemoryToRegisterPass(gallivm->passmgr);
+#if HAVE_LLVM < 0xd00
LLVMAddConstantPropagationPass(gallivm->passmgr);
+#endif
LLVMAddInstructionCombiningPass(gallivm->passmgr);
LLVMAddGVNPass(gallivm->passmgr);
}
diff -r 61d2f091ed91 -r c5398bbde6ed external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
--- a/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp Thu May 27 20:20:43 2021 +0000
+++ b/external/mit/MesaLib/dist/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp Sun May 30 01:53:30 2021 +0000
@@ -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>
Home |
Main Index |
Thread Index |
Old Index