This is an archive of the discontinued LLVM Phabricator instance.

[amdgpu][lds] Use a consistent order of fields in generated structs
ClosedPublic

Authored by JonChesterfield on Oct 24 2022, 7:13 AM.

Details

Summary

Avoids spurious and confusing test failures on changing implementation.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptOct 24 2022, 7:13 AM
JonChesterfield requested review of this revision.Oct 24 2022, 7:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 24 2022, 7:13 AM
arsenm added inline comments.Oct 24 2022, 8:20 AM
llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
399–401

I thought we had another sort that went on alignment and size with name as a tiebreaker already?

llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
399–401

Nope. That's what I wrote initially. It was replaced with OptimizedStructLayoutField which doesn't do that, order of arguments influences order of fields.

arsenm accepted this revision.Oct 31 2022, 7:30 PM

LGTM, although I would still expect anything "optimized" to be sorted by align and size

This revision is now accepted and ready to land.Oct 31 2022, 7:30 PM