From 8d4b0eddd613567b4f29088972b43104d8234f94 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Thu, 23 Jun 2016 20:00:34 +0000 Subject: [PATCH] AMDGPU: Add option to disable spilling SGPRs to VGPRs. This can help debug spilling problems. llvm-svn: 273605 --- llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp index 2b7c0f3a2e81..faab72ca9f92 100644 --- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp +++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp @@ -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 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( MF->getSubtarget().getRegisterInfo());