summarylogtreecommitdiffstats
path: root/0002-fix-ac_build_atomic_rmw-with-LLVM-13.patch
blob: 2bebd52e872147ffa9c38b2d3cb39f7eb426c96a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 5903405880c81dfffa9391d3df7e133da3160934 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <marek.olsak@amd.com>
Date: Tue, 2 Mar 2021 02:59:23 -0500
Subject: [PATCH] ac/llvm: fix ac_build_atomic_rmw with LLVM 13

---
 src/amd/llvm/ac_llvm_helper.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp
index ebeafaea553..0ab9517f431 100644
--- a/src/amd/llvm/ac_llvm_helper.cpp
+++ b/src/amd/llvm/ac_llvm_helper.cpp
@@ -321,6 +321,9 @@ LLVMValueRef ac_build_atomic_rmw(struct ac_llvm_context *ctx, LLVMAtomicRMWBinOp
    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));
 }
 
@@ -331,6 +334,9 @@ LLVMValueRef ac_build_atomic_cmp_xchg(struct ac_llvm_context *ctx, LLVMValueRef
    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));
 }
-- 
GitLab