[PATCH] D44952: AMDGPU: Really implement getFrameRegister
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 27 13:29:31 PDT 2018
arsenm created this revision.
arsenm added reviewers: kzhuravl, rampitec.
Herald added subscribers: JDevlieghere, t-tye, tpr, dstuttard, aprantl, yaxunl, nhaehnle, wdng.
Currently this seems to only really be used for debug info.
https://reviews.llvm.org/D44952
Files:
lib/Target/AMDGPU/AMDGPURegisterInfo.cpp
test/DebugInfo/AMDGPU/variable-locations.ll
Index: test/DebugInfo/AMDGPU/variable-locations.ll
===================================================================
--- test/DebugInfo/AMDGPU/variable-locations.ll
+++ test/DebugInfo/AMDGPU/variable-locations.ll
@@ -31,6 +31,9 @@
; 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)
Index: lib/Target/AMDGPU/AMDGPURegisterInfo.cpp
===================================================================
--- lib/Target/AMDGPU/AMDGPURegisterInfo.cpp
+++ lib/Target/AMDGPU/AMDGPURegisterInfo.cpp
@@ -82,5 +82,6 @@
}
unsigned SIRegisterInfo::getFrameRegister(const MachineFunction &MF) const {
- return AMDGPU::NoRegister;
+ const SIMachineFunctionInfo *FuncInfo = MF.getInfo<SIMachineFunctionInfo>();
+ return FuncInfo->getFrameOffsetReg();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44952.139992.patch
Type: text/x-patch
Size: 1105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180327/f995a465/attachment.bin>
More information about the llvm-commits
mailing list