This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Match global saddr addressing mode
ClosedPublic

Authored by arsenm on Aug 17 2020, 5:37 AM.

Details

Reviewers
rampitec
kzhuravl
Summary

The previous implementation was incorrect, and based off incorrect
instruction definitions. Unfortunately we can't match natural
addressing in a lot of cases due to the shift/scale applied in
getelementptrs. This relies on reducing the 64-bit shift to 32-bits.

Diff Detail

Event Timeline

arsenm created this revision.Aug 17 2020, 5:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2020, 5:37 AM
arsenm requested review of this revision.Aug 17 2020, 5:37 AM
rampitec added inline comments.Aug 17 2020, 11:39 AM
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
1789

You probably need to match OR as well, this is a canonical form.

arsenm added inline comments.Aug 17 2020, 11:55 AM
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
1789

This is for the variable offset, where add is less likely to turn into or. That's another edge case I'll look at in the next round (the other being SGPR base + imm offset should also probably use this with a 0 voffset instead of copying the base pointer)

rampitec accepted this revision.Aug 17 2020, 11:56 AM
This revision is now accepted and ready to land.Aug 17 2020, 11:56 AM