#include "AMDGPU.h"
#include "GCNSubtarget.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "SIMachineFunctionInfo.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/InitializePasses.h"
usingnamespacellvm;
#define DEBUG_TYPE …
MBBVector;
namespace {
class SILowerSGPRSpills : public MachineFunctionPass { … };
}
char SILowerSGPRSpills::ID = …;
INITIALIZE_PASS_BEGIN(SILowerSGPRSpills, DEBUG_TYPE,
"SI lower SGPR spill instructions", false, false)
INITIALIZE_PASS_DEPENDENCY(LiveIntervalsWrapperPass)
INITIALIZE_PASS_DEPENDENCY(VirtRegMap)
INITIALIZE_PASS_END(SILowerSGPRSpills, DEBUG_TYPE,
"SI lower SGPR spill instructions", false, false)
char &llvm::SILowerSGPRSpillsID = …;
static void insertCSRSaves(MachineBasicBlock &SaveBlock,
ArrayRef<CalleeSavedInfo> CSI, SlotIndexes *Indexes,
LiveIntervals *LIS) { … }
static void insertCSRRestores(MachineBasicBlock &RestoreBlock,
MutableArrayRef<CalleeSavedInfo> CSI,
SlotIndexes *Indexes, LiveIntervals *LIS) { … }
void SILowerSGPRSpills::calculateSaveRestoreBlocks(MachineFunction &MF) { … }
static void updateLiveness(MachineFunction &MF, ArrayRef<CalleeSavedInfo> CSI) { … }
bool SILowerSGPRSpills::spillCalleeSavedRegs(
MachineFunction &MF, SmallVectorImpl<int> &CalleeSavedFIs) { … }
void SILowerSGPRSpills::extendWWMVirtRegLiveness(MachineFunction &MF,
LiveIntervals *LIS) { … }
bool SILowerSGPRSpills::runOnMachineFunction(MachineFunction &MF) { … }