AMDGPU: Add option to disable spilling SGPRs to VGPRs.

This can help debug spilling problems.

llvm-svn: 273605
This commit is contained in:
Matt Arsenault 2016-06-23 20:00:34 +00:00
parent fe9d1ee9e4
commit 8d4b0eddd6
1 changed files with 9 additions and 2 deletions

View File

@ -1,11 +1,10 @@
//===-- SIMachineFunctionInfo.cpp - SI Machine Function Info -------===//
//===-- SIMachineFunctionInfo.cpp -------- SI Machine Function Info -------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
/// \file
//===----------------------------------------------------------------------===//
@ -22,6 +21,11 @@
using namespace llvm;
static cl::opt<bool> EnableSpillSGPRToVGPR(
"amdgpu-spill-sgpr-to-vgpr",
cl::desc("Enable spilling VGPRs to SGPRs"),
cl::ReallyHidden,
cl::init(true));
// Pin the vtable to this file.
void SIMachineFunctionInfo::anchor() {}
@ -178,6 +182,9 @@ SIMachineFunctionInfo::SpilledReg SIMachineFunctionInfo::getSpilledReg(
MachineFunction *MF,
unsigned FrameIndex,
unsigned SubIdx) {
if (!EnableSpillSGPRToVGPR)
return SpilledReg();
MachineFrameInfo *FrameInfo = MF->getFrameInfo();
const SIRegisterInfo *TRI = static_cast<const SIRegisterInfo *>(
MF->getSubtarget<AMDGPUSubtarget>().getRegisterInfo());