LowerAtomic.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //===- LowerAtomic.cpp - Lower atomic intrinsics ----------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. /// \file
  9. // This pass lowers atomic intrinsics to non-atomic form for use in a known
  10. // non-preemptible environment.
  11. ///
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_TRANSFORMS_SCALAR_LOWERATOMIC_H
  14. #define LLVM_TRANSFORMS_SCALAR_LOWERATOMIC_H
  15. #include "llvm/IR/PassManager.h"
  16. namespace llvm {
  17. /// A pass that lowers atomic intrinsic into non-atomic intrinsics.
  18. class LowerAtomicPass : public PassInfoMixin<LowerAtomicPass> {
  19. public:
  20. PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
  21. static bool isRequired() { return true; }
  22. };
  23. class AtomicRMWInst;
  24. /// Convert the given RMWI into primitive load and stores,
  25. /// assuming that doing so is legal. Return true if the lowering
  26. /// succeeds.
  27. bool lowerAtomicRMWInst(AtomicRMWInst *RMWI);
  28. }
  29. #endif // LLVM_TRANSFORMS_SCALAR_LOWERATOMIC_H