//===-- AMDGPUReserveWWMRegs.cpp - Add WWM Regs to reserved regs list -----===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // /// \file /// This pass should be invoked at the end of wwm-regalloc pipeline. /// It identifies the WWM regs allocated during this pipeline and add /// them to the list of reserved registers so that they won't be available for /// per-thread VGPR allocation in the subsequent regalloc pipeline. // //===----------------------------------------------------------------------===// #include "AMDGPU.h" #include "GCNSubtarget.h" #include "MCTargetDesc/AMDGPUMCTargetDesc.h" #include "SIMachineFunctionInfo.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/VirtRegMap.h" #include "llvm/InitializePasses.h" usingnamespacellvm; #define DEBUG_TYPE … namespace { class AMDGPUReserveWWMRegs : public MachineFunctionPass { … }; } // End anonymous namespace. INITIALIZE_PASS(…) char AMDGPUReserveWWMRegs::ID = …; char &llvm::AMDGPUReserveWWMRegsID = …; bool AMDGPUReserveWWMRegs::runOnMachineFunction(MachineFunction &MF) { … }