LLVM 24.0.0git
AMDGPUMachineModuleInfo.cpp
Go to the documentation of this file.
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
16#include "llvm/IR/Module.h"
18
19using namespace llvm;
20
23 LLVMContext &CTX = MMI.getModule()->getContext();
24 const Triple &TT = MMI.getModule()->getTargetTriple();
25
26 auto InsertScope = [&](AtomicScope Scope, bool OneAS) {
27 return CTX.getOrInsertSyncScopeID(
28 *getAtomicScopeIRString(TT, Scope, OneAS));
29 };
30 AgentSSID = InsertScope(AtomicScope::Device, /*OneAS=*/false);
31 WorkgroupSSID = InsertScope(AtomicScope::Workgroup, /*OneAS=*/false);
32 WavefrontSSID = InsertScope(AtomicScope::Wavefront, /*OneAS=*/false);
33 ClusterSSID = InsertScope(AtomicScope::Cluster, /*OneAS=*/false);
34 SystemOneAddressSpaceSSID = InsertScope(AtomicScope::System, /*OneAS=*/true);
35 AgentOneAddressSpaceSSID = InsertScope(AtomicScope::Device, /*OneAS=*/true);
36 WorkgroupOneAddressSpaceSSID =
37 InsertScope(AtomicScope::Workgroup, /*OneAS=*/true);
38 WavefrontOneAddressSpaceSSID =
39 InsertScope(AtomicScope::Wavefront, /*OneAS=*/true);
40 SingleThreadOneAddressSpaceSSID =
41 InsertScope(AtomicScope::Single, /*OneAS=*/true);
42 ClusterOneAddressSpaceSSID =
43 InsertScope(AtomicScope::Cluster, /*OneAS=*/true);
44}
AMDGPU Machine Module Info.
Module.h This file contains the declarations for the Module class.
Func getContext().diagnose(DiagnosticInfoUnsupported(Func
AMDGPUMachineModuleInfo(const MachineModuleInfo &MMI)
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:76
LLVM_ABI SyncScope::ID getOrInsertSyncScopeID(StringRef SSN)
getOrInsertSyncScopeID - Maps synchronization scope name to synchronization scope ID.
MachineModuleInfoELF(const MachineModuleInfo &)
This class contains meta information specific to a module.
const Module * getModule() const
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
This is an optimization pass for GlobalISel generic memory operations.
AtomicScope
Target-neutral memory synchronization scopes.
Definition AtomicScope.h:23
std::optional< StringRef > getAtomicScopeIRString(const Triple &T, AtomicScope S, bool IsSingleAddressSpace=false)
Returns the LLVM IR syncscope string that T uses to spell S.
Definition AtomicScope.h:34