This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Fix selection of constant 32-bit addrspace loads
ClosedPublic

Authored by arsenm on Jan 12 2022, 3:03 PM.

Details

Reviewers
mareko
foad
mbrkusanin
Petar.Avramovic
sebastian-ne
Group Reviewers
Restricted Project
Summary

Unfortunately the selection patterns still rely on the address space
from the memory operand instead of using the pointer type. Add this
address space to the list of cases supported by global-like loads.

Alternatively we would have to adjust the address space of the memory
operand to deviate from the underlying IR value, which looks ugly and
is more work in the legalizer.

This doesn't come up in the DAG path because it uses a different
selection strategy where the cast is inserted during the addressing
mode matching.

Diff Detail

Event Timeline

arsenm created this revision.Jan 12 2022, 3:03 PM
arsenm requested review of this revision.Jan 12 2022, 3:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2022, 3:03 PM
Herald added a subscriber: wdng. · View Herald Transcript
sebastian-ne accepted this revision.Jan 17 2022, 6:53 AM

The code looks fine to me.
Maybe the docs need updating, https://llvm.org/docs/AMDGPUUsage.html#address-spaces mentions addrspace(6), but the description is TODO.

This revision is now accepted and ready to land.Jan 17 2022, 6:53 AM