This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix wrong null value for private address space
ClosedPublic

Authored by arsenm on May 26 2020, 8:21 AM.

Details

Reviewers
rampitec
yaxunl
Summary

I'm guessing this was a holdover from when 0 was an invalid stack
pointer, but surprised nobody has discovered this before.

Also don't allow offset folding for -1 pointers, since it looks weird
to partially fold this.

Diff Detail

Event Timeline

arsenm created this revision.May 26 2020, 8:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2020, 8:21 AM
rampitec added inline comments.May 26 2020, 11:00 AM
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
1486

Can you compare it not to a literal but to getNullPointerValue(AMDGPUAS::PRIVATE_ADDRESS) please?

llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
3097–3098

Same here.

arsenm updated this revision to Diff 266290.May 26 2020, 12:02 PM

Don't hardcode null value

This revision is now accepted and ready to land.May 26 2020, 12:38 PM