Page MenuHomePhabricator

AMDGPU: Emit R_AMDGPU_ABS32_{HI,LO} for scratch buffer relocations
ClosedPublic

Authored by tstellarAMD on Jun 15 2016, 1:00 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

tstellarAMD retitled this revision from to AMDGPU: Emit R_AMDGPU_ABS32_{HI,LO} for scratch buffer relocations.
tstellarAMD updated this object.
tstellarAMD added a subscriber: llvm-commits.
kzhuravl added inline comments.Jun 16 2016, 9:20 AM
include/llvm/Object/RelocVisitor.h
144–146 ↗(On Diff #60885)

This processes HI relocations as LO. Should not LO and HI be processed differently, or am I missing something?

include/llvm/Object/RelocVisitor.h
144–146 ↗(On Diff #60885)

The RelocVisitor seems to only be used in DwarfContext.cpp. It's not clear me what it's even supposed to do with absolute relocations. Is this code even necessary?

kzhuravl added inline comments.Jun 16 2016, 11:55 AM
include/llvm/Object/RelocVisitor.h
144–146 ↗(On Diff #60885)

I think at this point we will only need to handle R_AMDGPU_ABS32 in RelocVisitor, since we are going to use it for dwarf relocs

Split changes outside of lib/Target/AMDGPU into a new patch: http://reviews.llvm.org/D21443

rafael added inline comments.Jun 17 2016, 6:03 AM
test/CodeGen/AMDGPU/large-alloca-compute.ll
5 ↗(On Diff #61025)

Why do you need to use "llc -filetype=obj"?

Please split this into tow tests. One prints assembly and checks it.
Another parses assembly and checks the relocations.

Split the test case in to to avoid using llc -filetype=obj

rafael edited edge metadata.Jun 18 2016, 5:49 AM
rafael added a subscriber: rafael.

Lgtm, but I have a question:

Will SCRATCH_RSRC_DWORD also need special treatment in the linker? If so
we should have special relocations for it to avoid using names in the
linker. This is similar to how the got position is accessed: magical name
for the assembler, different relocation for the linker.

Cheers,
Rafael

Lgtm, but I have a question:

Will SCRATCH_RSRC_DWORD also need special treatment in the linker? If so
we should have special relocations for it to avoid using names in the
linker. This is similar to how the got position is accessed: magical name
for the assembler, different relocation for the linker.

This won't need any special handling in the linker. This is only used by our legacy path which does not use lld at all.

kzhuravl accepted this revision.Jun 20 2016, 8:40 AM
kzhuravl edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jun 20 2016, 8:40 AM
This revision was automatically updated to reflect the committed changes.