[PATCH] D31443: [LTO] Do not reorder global variables unnecessarily during merging

Gerolf Hoflehner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 28 15:29:58 PDT 2017


Gerolf added a comment.

I'd love to see some comments an get your thoughts about a verifier.

Thank you
Gerolf



================
Comment at: lib/Object/ModuleSymbolTable.cpp:48
     SymTab.push_back(&GV);
+  for (Function &F : *M)
+    SymTab.push_back(&F);
----------------
Please add a comment about why the order of the for loop is relevant and how it relates to source code ordering. Also, could there be a verifier that source code order is preserved? 


================
Comment at: test/LTO/Resolution/X86/globalorder.ll:1
+; Check that the order of global variables is not unnecessarily
+; perturbed by LTO during module merging.
----------------
How about 'Check that LTO keeps global variables in source code order'?


https://reviews.llvm.org/D31443





More information about the llvm-commits mailing list