[PATCH] D136598: [amdgpu][lds] Use a consistent order of fields in generated structs

Jon Chesterfield via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 00:27:54 PDT 2022


JonChesterfield added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:399-401
+      llvm::sort(Sorted.begin(), Sorted.end(),
+                 [](const GlobalVariable *lhs, const GlobalVariable *rhs) {
+                   return lhs->getName() < rhs->getName();
----------------
arsenm wrote:
> I thought we had another sort that went on alignment and size with name as a tiebreaker already?
Nope. That's what I wrote initially. It was replaced with OptimizedStructLayoutField which doesn't do that, order of arguments influences order of fields.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136598/new/

https://reviews.llvm.org/D136598



More information about the llvm-commits mailing list