[AMDGPU] New gfx940 mfma instructions
[llvm-project.git] / llvm / lib / Target / AMDGPU / AMDGPUMIRFormatter.cpp
blobc3441f81a78ee9eabf397228d3eeabc51c12b8c3
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.
12 //===----------------------------------------------------------------------===//
14 #include "AMDGPUMIRFormatter.h"
15 #include "GCNSubtarget.h"
16 #include "SIMachineFunctionInfo.h"
18 using namespace llvm;
20 bool AMDGPUMIRFormatter::parseCustomPseudoSourceValue(
21 StringRef Src, MachineFunction &MF, PerFunctionMIParsingState &PFS,
22 const PseudoSourceValue *&PSV, ErrorCallbackType ErrorCallback) const {
23 SIMachineFunctionInfo *MFI = MF.getInfo<SIMachineFunctionInfo>();
24 const SIInstrInfo &TII = *MF.getSubtarget<GCNSubtarget>().getInstrInfo();
25 if (Src == "BufferResource") {
26 PSV = MFI->getBufferPSV(TII);
27 return false;
29 if (Src == "ImageResource") {
30 PSV = MFI->getImagePSV(TII);
31 return false;
33 if (Src == "GWSResource") {
34 PSV = MFI->getGWSPSV(TII);
35 return false;
37 llvm_unreachable("unknown MIR custom pseudo source value");