2012-12-11 21:25:42 +00:00
|
|
|
//===- SIMachineFunctionInfo.h - SIMachineFunctionInfo interface -*- C++ -*-==//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
/// \file
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef SIMACHINEFUNCTIONINFO_H_
|
|
|
|
#define SIMACHINEFUNCTIONINFO_H_
|
|
|
|
|
2013-04-01 21:47:53 +00:00
|
|
|
#include "AMDGPUMachineFunction.h"
|
2013-11-27 21:23:35 +00:00
|
|
|
#include <map>
|
2012-12-11 21:25:42 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2013-11-27 21:23:35 +00:00
|
|
|
class MachineRegisterInfo;
|
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
/// This class keeps track of the SPI_SP_INPUT_ADDR config register, which
|
|
|
|
/// tells the hardware which interpolation parameters to load.
|
2013-04-01 21:47:53 +00:00
|
|
|
class SIMachineFunctionInfo : public AMDGPUMachineFunction {
|
2013-11-19 00:57:56 +00:00
|
|
|
virtual void anchor();
|
2012-12-11 21:25:42 +00:00
|
|
|
public:
|
2013-11-27 21:23:35 +00:00
|
|
|
|
|
|
|
struct SpilledReg {
|
|
|
|
unsigned VGPR;
|
|
|
|
int Lane;
|
|
|
|
SpilledReg(unsigned R, int L) : VGPR (R), Lane (L) { }
|
|
|
|
SpilledReg() : VGPR(0), Lane(-1) { }
|
|
|
|
bool hasLane() { return Lane != -1;}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RegSpillTracker {
|
|
|
|
private:
|
|
|
|
unsigned CurrentLane;
|
|
|
|
std::map<unsigned, SpilledReg> SpilledRegisters;
|
|
|
|
public:
|
|
|
|
unsigned LaneVGPR;
|
|
|
|
RegSpillTracker() : CurrentLane(0), SpilledRegisters(), LaneVGPR(0) { }
|
|
|
|
unsigned getNextLane(MachineRegisterInfo &MRI);
|
|
|
|
void addSpilledReg(unsigned FrameIndex, unsigned Reg, int Lane = -1);
|
|
|
|
const SpilledReg& getSpilledReg(unsigned FrameIndex);
|
|
|
|
bool programSpillsRegisters() { return !SpilledRegisters.empty(); }
|
|
|
|
};
|
|
|
|
|
|
|
|
// SIMachineFunctionInfo definition
|
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
SIMachineFunctionInfo(const MachineFunction &MF);
|
2013-03-07 09:04:14 +00:00
|
|
|
unsigned PSInputAddr;
|
2013-11-27 21:23:35 +00:00
|
|
|
struct RegSpillTracker SpillTracker;
|
2012-12-11 21:25:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End namespace llvm
|
|
|
|
|
|
|
|
|
|
|
|
#endif //_SIMACHINEFUNCTIONINFO_H_
|