1//===--- AMDGPUMachineModuleInfo.cpp ----------------------------*- 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//
9/// \file
10/// AMDGPU Machine Module Info.
11///
12//
13//===----------------------------------------------------------------------===//
14
15#include "AMDGPUMachineModuleInfo.h"
16#include "llvm/IR/Module.h"
17
18using namespace llvm;
19
20AMDGPUMachineModuleInfo::AMDGPUMachineModuleInfo(const MachineModuleInfo &MMI)
21 : MachineModuleInfoELF(MMI) {
22 LLVMContext &CTX = MMI.getModule()->getContext();
23 AgentSSID = CTX.getOrInsertSyncScopeID(SSN: "agent");
24 WorkgroupSSID = CTX.getOrInsertSyncScopeID(SSN: "workgroup");
25 WavefrontSSID = CTX.getOrInsertSyncScopeID(SSN: "wavefront");
26 ClusterSSID = CTX.getOrInsertSyncScopeID(SSN: "cluster");
27 SystemOneAddressSpaceSSID =
28 CTX.getOrInsertSyncScopeID(SSN: "one-as");
29 AgentOneAddressSpaceSSID =
30 CTX.getOrInsertSyncScopeID(SSN: "agent-one-as");
31 WorkgroupOneAddressSpaceSSID =
32 CTX.getOrInsertSyncScopeID(SSN: "workgroup-one-as");
33 WavefrontOneAddressSpaceSSID =
34 CTX.getOrInsertSyncScopeID(SSN: "wavefront-one-as");
35 SingleThreadOneAddressSpaceSSID =
36 CTX.getOrInsertSyncScopeID(SSN: "singlethread-one-as");
37 ClusterOneAddressSpaceSSID = CTX.getOrInsertSyncScopeID(SSN: "cluster-one-as");
38}
39