This patch adds functionality to emit relevant libcalls in case atomicrmw instruction can not be emitted (for instance, in case of complex types). The IRBuilder is modified to directly emit __atomic_load and __atomic_compare_exchange libcalls. The added functions follow a similar codegen path as Clang, so that LLVM Flang generates almost similar IR as Clang. Fixes https://github.com/llvm/llvm-project/issues/83760 and https://github.com/llvm/llvm-project/issues/75138 Co-authored-by: Michael Kruse <llvm-project@meinersbur.de>
20 lines
648 B
C++
20 lines
648 B
C++
//===--- Atomic.h - Codegen of atomic operations
|
|
//---------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/Frontend/Atomic/Atomic.h"
|
|
#include "llvm/ADT/DenseMap.h"
|
|
#include "llvm/Frontend/Atomic/Atomic.h"
|
|
#include "llvm/IR/DataLayout.h"
|
|
#include "llvm/IR/Intrinsics.h"
|
|
#include "llvm/IR/Operator.h"
|
|
|
|
namespace {} // namespace
|
|
|
|
namespace llvm {} // end namespace llvm
|