This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][GlobalISel] GlobalISel for flat scratch
ClosedPublic

Authored by rampitec on Dec 21 2020, 5:08 PM.

Details

Summary

It does not seem to fold offsets but this is not specific
to the flat scratch as getPtrBaseWithConstantOffset() does
not return the split for these tests unlike its SDag
counterpart.

Diff Detail

Event Timeline

rampitec created this revision.Dec 21 2020, 5:08 PM
rampitec requested review of this revision.Dec 21 2020, 5:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 21 2020, 5:08 PM
Herald added a subscriber: wdng. · View Herald Transcript
sebastian-ne accepted this revision.Dec 22 2020, 4:59 AM

Looks good to me

This revision is now accepted and ready to land.Dec 22 2020, 4:59 AM

Not sure what you mean by the "split"

llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
3644–3645

Should hoist this up?

rampitec added inline comments.Dec 22 2020, 10:29 AM
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
3644–3645

The block above processes G_PTR_ADD and reassigns SAddrs. G_PTR_ADD produces VGPR but resulting register can end up SGPR.

arsenm added inline comments.Dec 22 2020, 10:34 AM
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
3644–3645

But the reassignment just creates an SGPR virt reg

rampitec added inline comments.Dec 22 2020, 10:36 AM
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
3644–3645

It creates SGPR if all checks of G_PTR_ADD succeeded and it is proved uniform. If I move the check up we will have no chance to porcess G_PTR_ADD.

This revision was automatically updated to reflect the committed changes.