1e8d8bef9SDimitry Andric //===- AMDGPUMIRFormatter.cpp ---------------------------------------------===// 2e8d8bef9SDimitry Andric // 3e8d8bef9SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4e8d8bef9SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5e8d8bef9SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6e8d8bef9SDimitry Andric // 7e8d8bef9SDimitry Andric //===----------------------------------------------------------------------===// 8e8d8bef9SDimitry Andric // 9e8d8bef9SDimitry Andric /// \file 10e8d8bef9SDimitry Andric /// Implementation of AMDGPU overrides of MIRFormatter. 11e8d8bef9SDimitry Andric // 12e8d8bef9SDimitry Andric //===----------------------------------------------------------------------===// 13e8d8bef9SDimitry Andric 14e8d8bef9SDimitry Andric #include "AMDGPUMIRFormatter.h" 15e8d8bef9SDimitry Andric #include "GCNSubtarget.h" 16e8d8bef9SDimitry Andric #include "SIMachineFunctionInfo.h" 17e8d8bef9SDimitry Andric 18e8d8bef9SDimitry Andric using namespace llvm; 19e8d8bef9SDimitry Andric parseCustomPseudoSourceValue(StringRef Src,MachineFunction & MF,PerFunctionMIParsingState & PFS,const PseudoSourceValue * & PSV,ErrorCallbackType ErrorCallback) const20e8d8bef9SDimitry Andricbool AMDGPUMIRFormatter::parseCustomPseudoSourceValue( 21e8d8bef9SDimitry Andric StringRef Src, MachineFunction &MF, PerFunctionMIParsingState &PFS, 22e8d8bef9SDimitry Andric const PseudoSourceValue *&PSV, ErrorCallbackType ErrorCallback) const { 23e8d8bef9SDimitry Andric SIMachineFunctionInfo *MFI = MF.getInfo<SIMachineFunctionInfo>(); 24*81ad6265SDimitry Andric const AMDGPUTargetMachine &TM = 25*81ad6265SDimitry Andric static_cast<const AMDGPUTargetMachine &>(MF.getTarget()); 26e8d8bef9SDimitry Andric if (Src == "GWSResource") { 27*81ad6265SDimitry Andric PSV = MFI->getGWSPSV(TM); 28e8d8bef9SDimitry Andric return false; 29e8d8bef9SDimitry Andric } 30e8d8bef9SDimitry Andric llvm_unreachable("unknown MIR custom pseudo source value"); 31e8d8bef9SDimitry Andric } 32