This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Account for globals in AMDGPUPromoteAlloca pass
ClosedPublic

Authored by bnieuwenhuizen on Mar 22 2016, 10:13 AM.

Details

Diff Detail

Event Timeline

bnieuwenhuizen retitled this revision from to AMDGPU: Account for globals in AMDGPUPromoteAlloca pass.
bnieuwenhuizen updated this object.
bnieuwenhuizen added a subscriber: llvm-commits.
arsenm added inline comments.Mar 22 2016, 10:44 AM
lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
128–129

You probably want to use GV.users() instead

133

Missing space before {

test/CodeGen/AMDGPU/promote-alloca-globals.ll
2

You should also include an llc run line and check for the final LDS usage

4

This should be after a CHECK-LABEL for the function name and moved down to the function

10–12

Can you run opt -instnamer on the test

25

This GEP isn't used?

test/CodeGen/AMDGPU/promote-alloca-globals.ll
2

How do you check for LDS usage? I can't find anything about LDS except the numerical representations of the RSRC registers.

25

It isn't as we just need a user of the global array to be used by an instruction inside the function to let the AMDGPUPromoteAlloca associate it with this function. I'll probably add a user though, to prevent llc from optimizing the LDS array away.

tstellarAMD added inline comments.Apr 1 2016, 1:43 PM
test/CodeGen/AMDGPU/promote-alloca-globals.ll
2

It doesn't look like we emit this currently. You emit this information from the AMDGPUAsmPrinter.cpp with the rest of the Kernel info.

arsenm edited edge metadata.Apr 14 2016, 4:40 PM

I added the LDS size to the comments, so you should be able to check this easily now

bnieuwenhuizen edited edge metadata.
v2: - Use users.
    - Check LDS size in testcase.
    - Ran instnamer on testcase.
    - Changed unused GEP.
    - Enlarge array for 64 KiB LDS.
arsenm accepted this revision.Apr 27 2016, 1:43 PM
arsenm edited edge metadata.

LGTM

This revision is now accepted and ready to land.Apr 27 2016, 1:43 PM
arsenm closed this revision.Apr 27 2016, 2:11 PM

r267791