[llvm] r273605 - AMDGPU: Add option to disable spilling SGPRs to VGPRs.
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 23 13:00:34 PDT 2016
Author: arsenm
Date: Thu Jun 23 15:00:34 2016
New Revision: 273605
URL: http://llvm.org/viewvc/llvm-project?rev=273605&view=rev
Log:
AMDGPU: Add option to disable spilling SGPRs to VGPRs.
This can help debug spilling problems.
Modified:
llvm/trunk/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp?rev=273605&r1=273604&r2=273605&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp Thu Jun 23 15:00:34 2016
@@ -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 SIMach
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());
More information about the llvm-commits
mailing list