Skip to content

Commit

Permalink
AMDGPU: Really implement getFrameRegister
Browse files Browse the repository at this point in the history
Currently this seems to only really be used for debug
info.

llvm-svn: 328677
  • Loading branch information
arsenm committed Mar 27, 2018
1 parent 07480bd commit bd49ecc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/Target/AMDGPU/AMDGPURegisterInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,6 @@ const uint32_t *SIRegisterInfo::getCallPreservedMask(const MachineFunction &MF,
}

unsigned SIRegisterInfo::getFrameRegister(const MachineFunction &MF) const {
return AMDGPU::NoRegister;
const SIMachineFunctionInfo *FuncInfo = MF.getInfo<SIMachineFunctionInfo>();
return FuncInfo->getFrameOffsetReg();
}
3 changes: 3 additions & 0 deletions llvm/test/DebugInfo/AMDGPU/variable-locations.ll
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ declare void @llvm.dbg.declare(metadata, metadata, 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)
Expand Down

0 comments on commit bd49ecc

Please sign in to comment.