[llvm] r328677 - AMDGPU: Really implement getFrameRegister

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 27 16:27:00 PDT 2018


Author: arsenm
Date: Tue Mar 27 16:26:59 2018
New Revision: 328677

URL: http://llvm.org/viewvc/llvm-project?rev=328677&view=rev
Log:
AMDGPU: Really implement getFrameRegister

Currently this seems to only really be used for debug
info.

Modified:
    llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterInfo.cpp
    llvm/trunk/test/DebugInfo/AMDGPU/variable-locations.ll

Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterInfo.cpp?rev=328677&r1=328676&r2=328677&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterInfo.cpp Tue Mar 27 16:26:59 2018
@@ -82,5 +82,6 @@ const uint32_t *SIRegisterInfo::getCallP
 }
 
 unsigned SIRegisterInfo::getFrameRegister(const MachineFunction &MF) const {
-  return AMDGPU::NoRegister;
+  const SIMachineFunctionInfo *FuncInfo = MF.getInfo<SIMachineFunctionInfo>();
+  return FuncInfo->getFrameOffsetReg();
 }

Modified: llvm/trunk/test/DebugInfo/AMDGPU/variable-locations.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/AMDGPU/variable-locations.ll?rev=328677&r1=328676&r2=328677&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/AMDGPU/variable-locations.ll (original)
+++ llvm/trunk/test/DebugInfo/AMDGPU/variable-locations.ll Tue Mar 27 16:26:59 2018
@@ -31,6 +31,9 @@ declare void @llvm.dbg.declare(metadata,
 ; CHECK-NEXT: DW_AT_location [DW_FORM_block1] (DW_OP_addr 0x0)
 @GlobB = common addrspace(1) global i32 0, align 4, !dbg !6
 
+; CHECK: {{.*}}DW_TAG_subprogram
+; CHECK: DW_AT_frame_base [DW_FORM_block1]	(DW_OP_reg9 SGPR9)
+
 define amdgpu_kernel void @kernel1(
 ; CHECK: {{.*}}DW_TAG_formal_parameter
 ; CHECK-NEXT: DW_AT_location [DW_FORM_block1] (DW_OP_fbreg +4, DW_OP_constu 0x1, DW_OP_swap, DW_OP_xderef)




More information about the llvm-commits mailing list