This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Legalize initialized LDS variables
ClosedPublic

Authored by cdevadas on Sep 16 2021, 11:00 AM.

Details

Summary

We don't allow an initializer for LDS variables
and there is an early abort during instruction
selection. This patch legalizes them by ignoring
the init values. During assembly emission, proper
error reporting already exists for such instances.

Diff Detail

Event Timeline

cdevadas created this revision.Sep 16 2021, 11:00 AM
cdevadas requested review of this revision.Sep 16 2021, 11:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 16 2021, 11:00 AM
arsenm added inline comments.Sep 16 2021, 11:05 AM
llvm/test/CodeGen/AMDGPU/legalize-lds-initializer.ll
2 ↗(On Diff #372997)

Do we not already have a test for this? I would prefer to run end-to-end to ensure the diagnostic is in fact emitted for the initializer in the end

cdevadas updated this revision to Diff 373038.Sep 16 2021, 12:54 PM

Addressed review comments.

arsenm accepted this revision.Sep 23 2021, 9:14 AM
arsenm added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
1381–1384

Should explicitly note this will error later

llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
2423–2429

Ditto

This revision is now accepted and ready to land.Sep 23 2021, 9:14 AM
This revision was automatically updated to reflect the committed changes.