diff options
author | Konstantin Zhuravlyov <kzhuravl_dev@outlook.com> | 2018-06-21 20:28:19 +0000 |
---|---|---|
committer | Konstantin Zhuravlyov <kzhuravl_dev@outlook.com> | 2018-06-21 20:28:19 +0000 |
commit | e004b3d97bcfce4885ff45210f97da60652dbddf (patch) | |
tree | 8326a7e9001f5be967afaabe72498e347f43c786 /llvm/lib/Target | |
parent | 37e9739a58bae4d357fd2570ad2db62cc94f7ed2 (diff) | |
download | bcm5719-llvm-e004b3d97bcfce4885ff45210f97da60652dbddf.tar.gz bcm5719-llvm-e004b3d97bcfce4885ff45210f97da60652dbddf.zip |
AMDGPU: Remove ability to reserve VGPRs for debugger
Differential Revision: https://reviews.llvm.org/D48234
llvm-svn: 335288
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPU.td | 7 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp | 17 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h | 7 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h | 13 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h | 1 |
6 files changed, 2 insertions, 50 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td index ca5128f41a8..2c921f0088f 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPU.td +++ b/llvm/lib/Target/AMDGPU/AMDGPU.td @@ -652,13 +652,6 @@ def FeatureDebuggerInsertNops : SubtargetFeature< "Insert one nop instruction for each high level source statement" >; -def FeatureDebuggerReserveRegs : SubtargetFeature< - "amdgpu-debugger-reserve-regs", - "DebuggerReserveRegs", - "true", - "Reserve registers for debugger usage" ->; - def FeatureDebuggerEmitPrologue : SubtargetFeature< "amdgpu-debugger-emit-prologue", "DebuggerEmitPrologue", diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp index c277bb4187b..9f79dbe65b7 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp @@ -475,13 +475,6 @@ bool AMDGPUAsmPrinter::runOnMachineFunction(MachineFunction &MF) { Twine(CurrentProgramInfo.NumVGPRsForWavesPerEU), false); OutStreamer->emitRawComment( - " ReservedVGPRFirst: " + Twine(CurrentProgramInfo.ReservedVGPRFirst), - false); - OutStreamer->emitRawComment( - " ReservedVGPRCount: " + Twine(CurrentProgramInfo.ReservedVGPRCount), - false); - - OutStreamer->emitRawComment( " WaveLimiterHint : " + Twine(MFI->needsWaveLimiter()), false); if (MF.getSubtarget<SISubtarget>().debuggerEmitPrologue()) { @@ -831,7 +824,6 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo, // unified. unsigned ExtraSGPRs = IsaInfo::getNumExtraSGPRs( STM.getFeatureBits(), ProgInfo.VCCUsed, ProgInfo.FlatUsed); - unsigned ExtraVGPRs = STM.getReservedNumVGPRs(MF); // Check the addressable register limit before we add ExtraSGPRs. if (STM.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS && @@ -852,7 +844,6 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo, // Account for extra SGPRs and VGPRs reserved for debugger use. ProgInfo.NumSGPR += ExtraSGPRs; - ProgInfo.NumVGPR += ExtraVGPRs; // Ensure there are enough SGPRs and VGPRs for wave dispatch, where wave // dispatch registers are function args. @@ -918,10 +909,6 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo, ProgInfo.VGPRBlocks = IsaInfo::getNumVGPRBlocks( STM.getFeatureBits(), ProgInfo.NumVGPRsForWavesPerEU); - // Record first reserved VGPR and number of reserved VGPRs. - ProgInfo.ReservedVGPRFirst = STM.debuggerReserveRegs() ? ProgInfo.NumVGPR : 0; - ProgInfo.ReservedVGPRCount = STM.getReservedNumVGPRs(MF); - // Update DebuggerWavefrontPrivateSegmentOffsetSGPR and // DebuggerPrivateSegmentBufferSGPR fields if "amdgpu-debugger-emit-prologue" // attribute was requested. @@ -1196,8 +1183,6 @@ void AMDGPUAsmPrinter::getAmdKernelCode(amd_kernel_code_t &Out, Out.workitem_vgpr_count = CurrentProgramInfo.NumVGPR; Out.workitem_private_segment_byte_size = CurrentProgramInfo.ScratchSize; Out.workgroup_group_segment_byte_size = CurrentProgramInfo.LDSSize; - Out.reserved_vgpr_first = CurrentProgramInfo.ReservedVGPRFirst; - Out.reserved_vgpr_count = CurrentProgramInfo.ReservedVGPRCount; // These alignment values are specified in powers of two, so alignment = // 2^n. The minimum alignment is 2^4 = 16. @@ -1248,8 +1233,6 @@ AMDGPU::HSAMD::Kernel::DebugProps::Metadata AMDGPUAsmPrinter::getHSADebugProps( HSADebugProps.mDebuggerABIVersion.push_back(1); HSADebugProps.mDebuggerABIVersion.push_back(0); - HSADebugProps.mReservedNumVGPRs = ProgramInfo.ReservedVGPRCount; - HSADebugProps.mReservedFirstVGPR = ProgramInfo.ReservedVGPRFirst; if (STM.debuggerEmitPrologue()) { HSADebugProps.mPrivateSegmentBufferSGPR = diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h b/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h index e1a95595aa6..24d7302fe82 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h @@ -84,13 +84,6 @@ private: // Number of VGPRs that meets number of waves per execution unit request. uint32_t NumVGPRsForWavesPerEU = 0; - // If ReservedVGPRCount is 0 then must be 0. Otherwise, this is the first - // fixed VGPR number reserved. - uint16_t ReservedVGPRFirst = 0; - - // The number of consecutive VGPRs reserved. - uint16_t ReservedVGPRCount = 0; - // Fixed SGPR number used to hold wave scratch offset for entire kernel // execution, or std::numeric_limits<uint16_t>::max() if the register is not // used or not known. diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp index 97fc6493b95..b632298ba17 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp @@ -124,7 +124,6 @@ AMDGPUSubtarget::AMDGPUSubtarget(const Triple &TT, StringRef GPU, StringRef FS, EnableXNACK(false), TrapHandler(false), DebuggerInsertNops(false), - DebuggerReserveRegs(false), DebuggerEmitPrologue(false), EnableHugePrivateBuffer(false), @@ -550,10 +549,6 @@ unsigned SISubtarget::getMaxNumVGPRs(const MachineFunction &MF) const { unsigned Requested = AMDGPU::getIntegerAttribute( F, "amdgpu-num-vgpr", MaxNumVGPRs); - // Make sure requested value does not violate subtarget's specifications. - if (Requested && Requested <= getReservedNumVGPRs(MF)) - Requested = 0; - // Make sure requested value is compatible with values implied by // default/requested minimum/maximum number of waves per execution unit. if (Requested && Requested > getMaxNumVGPRs(WavesPerEU.first)) @@ -566,7 +561,7 @@ unsigned SISubtarget::getMaxNumVGPRs(const MachineFunction &MF) const { MaxNumVGPRs = Requested; } - return MaxNumVGPRs - getReservedNumVGPRs(MF); + return MaxNumVGPRs; } namespace { diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h index b4b0873eaf3..333b99f9ced 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h @@ -124,7 +124,6 @@ protected: bool EnableXNACK; bool TrapHandler; bool DebuggerInsertNops; - bool DebuggerReserveRegs; bool DebuggerEmitPrologue; // Used as options. @@ -823,18 +822,13 @@ public: } bool debuggerSupported() const { - return debuggerInsertNops() && debuggerReserveRegs() && - debuggerEmitPrologue(); + return debuggerInsertNops() && debuggerEmitPrologue(); } bool debuggerInsertNops() const { return DebuggerInsertNops; } - bool debuggerReserveRegs() const { - return DebuggerReserveRegs; - } - bool debuggerEmitPrologue() const { return DebuggerEmitPrologue; } @@ -962,11 +956,6 @@ public: return AMDGPU::IsaInfo::getMaxNumVGPRs(getFeatureBits(), WavesPerEU); } - /// \returns Reserved number of VGPRs for given function \p MF. - unsigned getReservedNumVGPRs(const MachineFunction &MF) const { - return debuggerReserveRegs() ? 4 : 0; - } - /// \returns Maximum number of VGPRs that meets number of waves per execution /// unit requirement for function \p MF, or number of VGPRs explicitly /// requested using "amdgpu-num-vgpr" attribute attached to function \p MF. diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h index 0735b48a625..495229029fe 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h @@ -85,7 +85,6 @@ class GCNTTIImpl final : public BasicTTIImplBase<GCNTTIImpl> { AMDGPU::FeatureAutoWaitcntBeforeBarrier, AMDGPU::FeatureDebuggerEmitPrologue, AMDGPU::FeatureDebuggerInsertNops, - AMDGPU::FeatureDebuggerReserveRegs, // Property of the kernel/environment which can't actually differ. AMDGPU::FeatureSGPRInitBug, |