[PATCH] D22302: [ThinLTO/gold] Perform index-based weak/linkonce resolution

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 13:36:26 PDT 2016


mehdi_amini added inline comments.

================
Comment at: tools/gold/gold-plugin.cpp:1023
@@ -1021,1 +1022,3 @@
+      saveBCFile(OptFilename, *M);
+    }
   }
----------------
tejohnson wrote:
> mehdi_amini wrote:
> > Is this related to the rest of this patch? How was it handled before? 
> It is related in the sense that the new test uses the .import.bc file to do some checking (before the optimization pipeline kicks in and does inlining, e.g.). But actually, I just changed the test to check the .opt.bc saved temps files and it still works - looks like the linkonce_odr removal doesn't happen until code gen. I will remove this new block (which is also useful for debugging, but not then related to this patch, I can submit separately) and change the test.
I'm not sure what you mean with linkonce_odr removal does not happen until codegen?
If you turn it into an available_externally, we should always remove them after the inliner is complete.
If you don't turn them into available_externally but they are inlined, the inline is supposed to remove them:

```
/// Remove now-dead linkonce functions at the end of
/// processing to avoid breaking the SCC traversal.
bool Inliner::doFinalization(CallGraph &CG) {
  return removeDeadFunctions(CG);
}
```



https://reviews.llvm.org/D22302





More information about the llvm-commits mailing list