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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 15 16:40:37 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL332415: [MachineOutliner] Add optsize markings to outlined functions. (authored by efriedma, committed by ).
Herald added a reviewer: javed.absar.

Changed prior to commit:
  https://reviews.llvm.org/D46373?vs=144962&id=146962#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D46373

Files:
  llvm/trunk/lib/CodeGen/MachineOutliner.cpp
  llvm/trunk/test/CodeGen/AArch64/machine-outliner.ll


Index: llvm/trunk/test/CodeGen/AArch64/machine-outliner.ll
===================================================================
--- llvm/trunk/test/CodeGen/AArch64/machine-outliner.ll
+++ llvm/trunk/test/CodeGen/AArch64/machine-outliner.ll
@@ -1,4 +1,5 @@
 ; RUN: llc -verify-machineinstrs -enable-machine-outliner -mtriple=aarch64-apple-darwin < %s | FileCheck %s
+; RUN: llc -verify-machineinstrs -enable-machine-outliner -mtriple=aarch64-apple-darwin -mcpu=cortex-a53 -enable-misched=false < %s | FileCheck %s
 ; RUN: llc -verify-machineinstrs -enable-machine-outliner -enable-linkonceodr-outlining -mtriple=aarch64-apple-darwin < %s | FileCheck %s -check-prefix=ODR
 
 define linkonce_odr void @fish() #0 {
@@ -67,7 +68,8 @@
 }
 
 ; ODR: [[OUTLINED]]:
-; CHECK: [[OUTLINED]]:
+; CHECK: .p2align 2
+; CHECK-NEXT: [[OUTLINED]]:
 ; CHECK-DAG: orr w8, wzr, #0x1
 ; CHECK-NEXT: stp w8, wzr, [sp, #8]
 ; CHECK-NEXT: orr w8, wzr, #0x2
Index: llvm/trunk/lib/CodeGen/MachineOutliner.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/MachineOutliner.cpp
+++ llvm/trunk/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.146962.patch
Type: text/x-patch
Size: 1645 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180515/3c29e610/attachment.bin>


More information about the llvm-commits mailing list