[PATCH] D18235: [LTO] Call the optimizer before invoking codegen

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 16 18:38:03 PDT 2016


silvas added inline comments.

================
Comment at: ELF/SymbolTable.cpp:114
@@ +113,3 @@
+// This is for use when debugging LTO.
+static void saveBCFile(Module &M, bool Optimized) {
+  std::error_code EC;
----------------
instead of `bool Optimized` do `const char *Suffix` or `StringRef Suffix` or something.

================
Comment at: ELF/SymbolTable.cpp:143
@@ -128,1 +142,3 @@
 
+  // LTOPasses.
+  M.setDataLayout(TM->createDataLayout());
----------------
Can you mention the relation to the code in gold-plugin.cpp? Something like "For now, we follow what gold-plugin.cpp does" maybe?

================
Comment at: test/ELF/lto/ctors.ll:15
@@ +14,2 @@
+; The llvm.global_ctors should be stripped away.
+; CHECK-NOT: Name: .ctors
----------------
This kind of defeats the original purpose of this test. Can you put a volatile asm in `@ctor` (so it is kept) and also some piece of trivially dead code. We can do -save-temps and check that the optimized output does not have the trivially dead code without having to remove the original check.


http://reviews.llvm.org/D18235





More information about the llvm-commits mailing list