blob: 98fe75b7a13ffc8e06ba472f71830d5c38355e71 [file] [log] [blame]
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +00001//===--- 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
23namespace llvm {
24
25class AMDGPUMachineModuleInfo final : public MachineModuleInfoELF {
26private:
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
38public:
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