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
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#ifndef LLVM_LIB_TARGET_R600_SIMACHINEFUNCTIONINFO_H
|
|
|
|
#define LLVM_LIB_TARGET_R600_SIMACHINEFUNCTIONINFO_H
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2013-04-01 21:47:53 +00:00
|
|
|
#include "AMDGPUMachineFunction.h"
|
2014-09-24 01:33:17 +00:00
|
|
|
#include "SIRegisterInfo.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 {
|
2014-04-29 07:57:24 +00:00
|
|
|
void anchor() override;
|
2014-09-24 01:33:17 +00:00
|
|
|
|
|
|
|
unsigned TIDReg;
|
2015-01-14 15:42:31 +00:00
|
|
|
bool HasSpilledVGPRs;
|
2014-09-24 01:33:17 +00:00
|
|
|
|
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;}
|
|
|
|
};
|
|
|
|
|
|
|
|
// SIMachineFunctionInfo definition
|
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
SIMachineFunctionInfo(const MachineFunction &MF);
|
2014-08-21 20:40:54 +00:00
|
|
|
SpilledReg getSpilledReg(MachineFunction *MF, unsigned FrameIndex,
|
|
|
|
unsigned SubIdx);
|
2013-03-07 09:04:14 +00:00
|
|
|
unsigned PSInputAddr;
|
2014-07-21 15:45:01 +00:00
|
|
|
unsigned NumUserSGPRs;
|
2014-08-21 20:40:54 +00:00
|
|
|
std::map<unsigned, unsigned> LaneVGPRs;
|
2014-09-24 01:33:17 +00:00
|
|
|
unsigned LDSWaveSpillSize;
|
2015-01-20 19:33:04 +00:00
|
|
|
unsigned ScratchOffsetReg;
|
2014-09-24 01:33:17 +00:00
|
|
|
bool hasCalculatedTID() const { return TIDReg != AMDGPU::NoRegister; };
|
|
|
|
unsigned getTIDReg() const { return TIDReg; };
|
|
|
|
void setTIDReg(unsigned Reg) { TIDReg = Reg; }
|
2015-01-14 15:42:31 +00:00
|
|
|
bool hasSpilledVGPRs() const { return HasSpilledVGPRs; }
|
|
|
|
void setHasSpilledVGPRs(bool Spill = true) { HasSpilledVGPRs = Spill; }
|
2014-09-24 01:33:17 +00:00
|
|
|
|
|
|
|
unsigned getMaximumWorkGroupSize(const MachineFunction &MF) const;
|
2012-12-11 21:25:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End namespace llvm
|
|
|
|
|
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#endif
|