This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix module LDS selection
ClosedPublic

Authored by rampitec on May 20 2021, 3:36 PM.

Details

Summary

Accesses to global module LDS variable start from null,
but kernel also thinks its variables start address is
null. Fixed by not using a null as an address.

Diff Detail

Event Timeline

rampitec created this revision.May 20 2021, 3:36 PM
rampitec requested review of this revision.May 20 2021, 3:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 20 2021, 3:36 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm added inline comments.May 20 2021, 3:43 PM
llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
67

getNamedGlobal?

rampitec updated this revision to Diff 346876.May 20 2021, 3:44 PM
JonChesterfield accepted this revision.May 20 2021, 3:45 PM

That is much prettier, thank you.

We have the magic string "llvm.amdgcn.module.lds" in a few places now, might be worth putting that behind a function call. Separate to the above, if we do it at all.

This revision is now accepted and ready to land.May 20 2021, 3:45 PM
rampitec added inline comments.May 20 2021, 3:46 PM
llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
67

Probably. But that's a different change I guess.

arsenm added inline comments.May 20 2021, 3:46 PM
llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
67

No, that's the wrapper that passes true in for you

rampitec updated this revision to Diff 346878.May 20 2021, 3:50 PM
rampitec marked 2 inline comments as done.

That is much prettier, thank you.

We have the magic string "llvm.amdgcn.module.lds" in a few places now, might be worth putting that behind a function call. Separate to the above, if we do it at all.

Yeah, I think we need a function to return it or define.

llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
67

Ah, right.

This revision was landed with ongoing or failed builds.May 20 2021, 3:59 PM
This revision was automatically updated to reflect the committed changes.