LLVM  16.0.0git
AMDGPUMIRFormatter.cpp
Go to the documentation of this file.
1 //===- AMDGPUMIRFormatter.cpp ---------------------------------------------===//
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 /// Implementation of AMDGPU overrides of MIRFormatter.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "AMDGPUMIRFormatter.h"
15 #include "GCNSubtarget.h"
16 #include "SIMachineFunctionInfo.h"
17 
18 using namespace llvm;
19 
22  const PseudoSourceValue *&PSV, ErrorCallbackType ErrorCallback) const {
24  const AMDGPUTargetMachine &TM =
25  static_cast<const AMDGPUTargetMachine &>(MF.getTarget());
26  if (Src == "GWSResource") {
27  PSV = MFI->getGWSPSV(TM);
28  return false;
29  }
30  llvm_unreachable("unknown MIR custom pseudo source value");
31 }
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
SIMachineFunctionInfo.h
llvm::AMDGPUMIRFormatter::parseCustomPseudoSourceValue
bool parseCustomPseudoSourceValue(StringRef Src, MachineFunction &MF, PerFunctionMIParsingState &PFS, const PseudoSourceValue *&PSV, ErrorCallbackType ErrorCallback) const override
Implement target specific parsing of target custom pseudo source value.
Definition: AMDGPUMIRFormatter.cpp:20
llvm::SIMachineFunctionInfo::getGWSPSV
const AMDGPUGWSResourcePseudoSourceValue * getGWSPSV(const AMDGPUTargetMachine &TM)
Definition: SIMachineFunctionInfo.h:923
llvm::AMDGPUTargetMachine
Definition: AMDGPUTargetMachine.h:29
GCNSubtarget.h
llvm::MachineFunction::getInfo
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Definition: MachineFunction.h:755
AMDGPUMIRFormatter.h
llvm::PseudoSourceValue
Special value supplied for machine level alias analysis.
Definition: PseudoSourceValue.h:35
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLFunctionalExtras.h:36
llvm::MachineFunction
Definition: MachineFunction.h:257
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
llvm::PerFunctionMIParsingState
Definition: MIParser.h:162
llvm::MachineFunction::getTarget
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Definition: MachineFunction.h:653
llvm::SIMachineFunctionInfo
This class keeps track of the SPI_SP_INPUT_ADDR config register, which tells the hardware which inter...
Definition: SIMachineFunctionInfo.h:325
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47