Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 1 | //===--- AMDGPUMachineModuleInfo.h ------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | /// \file |
| 11 | /// \brief AMDGPU Machine Module Info. |
| 12 | /// |
| 13 | // |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEMODULEINFO_H |
| 17 | #define LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEMODULEINFO_H |
| 18 | |
| 19 | #include "llvm/CodeGen/MachineModuleInfo.h" |
| 20 | #include "llvm/CodeGen/MachineModuleInfoImpls.h" |
| 21 | #include "llvm/IR/LLVMContext.h" |
| 22 | |
| 23 | namespace llvm { |
| 24 | |
| 25 | class AMDGPUMachineModuleInfo final : public MachineModuleInfoELF { |
| 26 | private: |
| 27 | |
| 28 | // All supported memory/synchronization scopes can be found here: |
| 29 | // http://llvm.org/docs/AMDGPUUsage.html#memory-scopes |
| 30 | |
| 31 | /// \brief Agent synchronization scope ID. |
| 32 | SyncScope::ID AgentSSID; |
| 33 | /// \brief Workgroup synchronization scope ID. |
| 34 | SyncScope::ID WorkgroupSSID; |
| 35 | /// \brief Wavefront synchronization scope ID. |
| 36 | SyncScope::ID WavefrontSSID; |
| 37 | |
| 38 | public: |
| 39 | AMDGPUMachineModuleInfo(const MachineModuleInfo &MMI); |
| 40 | |
| 41 | /// \returns Agent synchronization scope ID. |
| 42 | SyncScope::ID getAgentSSID() const { |
| 43 | return AgentSSID; |
| 44 | } |
| 45 | /// \returns Workgroup synchronization scope ID. |
| 46 | SyncScope::ID getWorkgroupSSID() const { |
| 47 | return WorkgroupSSID; |
| 48 | } |
| 49 | /// \returns Wavefront synchronization scope ID. |
| 50 | SyncScope::ID getWavefrontSSID() const { |
| 51 | return WavefrontSSID; |
| 52 | } |
| 53 | }; |
| 54 | |
| 55 | } // end namespace llvm |
| 56 | |
| 57 | #endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEMODULEINFO_H |