Page MenuHomePhabricator

[AMDGPU][GlobalISel] Improve constant offset lookup for llvm.amdgcn.s.buffer
Needs RevisionPublic

Authored by mbrkusanin on Mar 5 2021, 6:09 AM.

Details

Reviewers
foad
arsenm
Summary

Looking up constant offset for this intrinsic is done during RegBankSelect
so the constant might find itself behind a copy from sgpr to vgpr.

Diff Detail

Event Timeline

mbrkusanin created this revision.Mar 5 2021, 6:09 AM
mbrkusanin requested review of this revision.Mar 5 2021, 6:09 AM
arsenm added inline comments.Mar 5 2021, 6:17 AM
llvm/lib/Target/AMDGPU/AMDGPUGlobalISelUtils.cpp
51

This shouldn't add a second match pattern for a copy. That should be hidden away somehow. In this case I'd say the problem is regbankselect isn't picking the correct bank for the constant in the first place since we don't consider the users right now. We've been working around this on a case by case basis, but I think we should try to fix this.

Also arguably mi_match should look through copies, although in the presence of cross reg bank copies that's more questionable

arsenm requested changes to this revision.Mar 30 2021, 3:20 PM
This revision now requires changes to proceed.Mar 30 2021, 3:20 PM