This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Emit constant address space data in .rodata section and use relocations instead of fixups (amdhsa only)
ClosedPublic

Authored by kzhuravl on Oct 17 2016, 12:31 PM.

Diff Detail

Event Timeline

kzhuravl updated this revision to Diff 74886.Oct 17 2016, 12:31 PM
kzhuravl retitled this revision from to [AMDGPU] Emit constant address space data in .rodata section and use relocations instead of fixups (amdhsa only).
kzhuravl updated this object.
kzhuravl added a reviewer: tstellarAMD.
kzhuravl added a subscriber: llvm-commits.
tony-tye added inline comments.Oct 17 2016, 1:11 PM
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
60

Would it be better to name this isEmitConstantsToTextSection or shouldEmitConstantsToTextSection since it does not actually do the emitting?

kzhuravl added inline comments.Oct 17 2016, 1:44 PM
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
60

Yes, shouldEmitConstantsToTextSection sounds a lot better and in the same naming spirit as shouldEmitFixup, shouldEmitGOTReloc, etc. Thanks.

kzhuravl updated this revision to Diff 75001.Oct 18 2016, 7:50 AM
kzhuravl edited edge metadata.
kzhuravl marked an inline comment as done.

Rename emitConstantsToTextSection -> shouldEmitConstantsToTextSection. Make offset folding legal for constant address space.

test/CodeGen/AMDGPU/global-constant.ll
3–7

I think this patch also fixes the case where we have an external variable in address space 2. I would add a test for that here. If I'm wrong and this patch doesn't fix this, then we can add the test case along with the fix for it in a follow-up patch.

kzhuravl updated this revision to Diff 75192.Oct 19 2016, 12:12 PM
kzhuravl edited edge metadata.

Bring up to date with trunk

kzhuravl updated this revision to Diff 75208.Oct 19 2016, 1:05 PM
kzhuravl edited edge metadata.
kzhuravl marked an inline comment as done.

Address review feedback.

tstellarAMD accepted this revision.Oct 19 2016, 1:06 PM
tstellarAMD edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Oct 19 2016, 1:06 PM
This revision was automatically updated to reflect the committed changes.