LLVM  13.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 SIInstrInfo &TII = *MF.getSubtarget<GCNSubtarget>().getInstrInfo();
25  if (Src == "BufferResource") {
26  PSV = MFI->getBufferPSV(TII);
27  return false;
28  }
29  if (Src == "ImageResource") {
30  PSV = MFI->getImagePSV(TII);
31  return false;
32  }
33  if (Src == "GWSResource") {
34  PSV = MFI->getGWSPSV(TII);
35  return false;
36  }
37  llvm_unreachable("unknown MIR custom pseudo source value");
38 }
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
SIMachineFunctionInfo.h
llvm::AMDGPUMIRFormatter::parseCustomPseudoSourceValue
virtual 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::getBufferPSV
const AMDGPUBufferPseudoSourceValue * getBufferPSV(const SIInstrInfo &TII)
Definition: SIMachineFunctionInfo.h:904
llvm::GCNSubtarget
Definition: GCNSubtarget.h:38
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:720
AMDGPUMIRFormatter.h
TII
const HexagonInstrInfo * TII
Definition: HexagonCopyToCombine.cpp:129
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: STLExtras.h:168
llvm::SIMachineFunctionInfo::getImagePSV
const AMDGPUImagePseudoSourceValue * getImagePSV(const SIInstrInfo &TII)
Definition: SIMachineFunctionInfo.h:911
llvm::MachineFunction::getSubtarget
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Definition: MachineFunction.h:622
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::PerFunctionMIParsingState
Definition: MIParser.h:162
llvm::SIMachineFunctionInfo::getGWSPSV
const AMDGPUGWSResourcePseudoSourceValue * getGWSPSV(const SIInstrInfo &TII)
Definition: SIMachineFunctionInfo.h:918
llvm::SIInstrInfo
Definition: SIInstrInfo.h:38
llvm::SIMachineFunctionInfo
This class keeps track of the SPI_SP_INPUT_ADDR config register, which tells the hardware which inter...
Definition: SIMachineFunctionInfo.h:335