ac/llvm: fix ac_build_atomic_rmw with LLVM 13

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4383

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9361>
This commit is contained in:
Marek Olšák 2021-03-02 02:59:23 -05:00 committed by Marge Bot
parent 8bd0cc1a5a
commit f9e6c7a220

View file

@ -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));
}