[PATCH] D46373: [MachineOutliner] Add optsize markings to outlined functions.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 2 18:21:13 PDT 2018


efriedma created this revision.
efriedma added a reviewer: jpaquette.

It doesn't matter much this late in the pipeline, but one place that does check for optsize is the function alignment code.


Repository:
  rL LLVM

https://reviews.llvm.org/D46373

Files:
  lib/CodeGen/MachineOutliner.cpp


Index: lib/CodeGen/MachineOutliner.cpp
===================================================================
--- lib/CodeGen/MachineOutliner.cpp
+++ lib/CodeGen/MachineOutliner.cpp
@@ -1253,6 +1253,14 @@
   F->setLinkage(GlobalValue::InternalLinkage);
   F->setUnnamedAddr(GlobalValue::UnnamedAddr::Global);
 
+  // FIXME: Set nounwind, so we don't generate eh_frame? Haven't verified it's
+  // necessary.
+
+  // Set optsize/minsize, so we don't insert padding between outlined
+  // functions.
+  F->addFnAttr(Attribute::OptimizeForSize);
+  F->addFnAttr(Attribute::MinSize);
+
   // Save F so that we can add debug info later if we need to.
   CreatedIRFunctions.push_back(F);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46373.144962.patch
Type: text/x-patch
Size: 681 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180503/c8f77602/attachment.bin>


More information about the llvm-commits mailing list