[PATCH] D34806: [MergeFunctions] Merge small functions if possible without a thunk

JF Bastien via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 21:49:50 PDT 2017


jfb accepted this revision.
jfb added a comment.
This revision is now accepted and ready to land.

A few questions, but this looks good.



================
Comment at: lib/Transforms/IPO/MergeFunctions.cpp:653
+  if (F->size() == 1) {
+    if (F->front().size() <= 2) {
+      DEBUG(dbgs() << "writeThunk: " << F->getName() 
----------------
So I know that you're just moving code, but why these numbers? What's the usual thunk size? You also need to consider alignment (both of the function and thunks). IIRC there was a bunch of waste with alignment even when merge funcs ran, and I don't think it got fixed.


================
Comment at: lib/Transforms/IPO/MergeFunctions.cpp:785
-  // FIXME: Should still merge them if they are unnamed_addr and produce an
-  // alias.
-  if (NewFunction->size() == 1) {
----------------
Weird that this code was way late here.

This fixme isn't relevant right? It's handled at line 631 it seems like.


Repository:
  rL LLVM

https://reviews.llvm.org/D34806





More information about the llvm-commits mailing list