1 //===-- SIMachineFunctionInfo.cpp - SI Machine Function Info -------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
12 #include "SIMachineFunctionInfo.h"
13 #include "SIRegisterInfo.h"
14 #include "llvm/CodeGen/MachineRegisterInfo.h"
21 // Pin the vtable to this file.
22 void SIMachineFunctionInfo::anchor() {}
24 SIMachineFunctionInfo::SIMachineFunctionInfo(const MachineFunction &MF)
25 : AMDGPUMachineFunction(MF),
29 static unsigned createLaneVGPR(MachineRegisterInfo &MRI) {
30 return MRI.createVirtualRegister(&AMDGPU::VReg_32RegClass);
33 unsigned SIMachineFunctionInfo::RegSpillTracker::getNextLane(MachineRegisterInfo &MRI) {
35 LaneVGPR = createLaneVGPR(MRI);
38 if (CurrentLane == MAX_LANES) {
40 LaneVGPR = createLaneVGPR(MRI);
46 void SIMachineFunctionInfo::RegSpillTracker::addSpilledReg(unsigned FrameIndex,
49 SpilledRegisters[FrameIndex] = SpilledReg(Reg, Lane);
52 const SIMachineFunctionInfo::SpilledReg&
53 SIMachineFunctionInfo::RegSpillTracker::getSpilledReg(unsigned FrameIndex) {
54 return SpilledRegisters[FrameIndex];