[llvm] r332415 - [MachineOutliner] Add optsize markings to outlined functions.
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Tue May 15 16:36:46 PDT 2018
Author: efriedma
Date: Tue May 15 16:36:46 2018
New Revision: 332415
URL: http://llvm.org/viewvc/llvm-project?rev=332415&view=rev
Log:
[MachineOutliner] Add optsize markings to outlined functions.
It doesn't matter much this late in the pipeline, but one place that
does check for it is the function alignment code.
Differential Revision: https://reviews.llvm.org/D46373
Modified:
llvm/trunk/lib/CodeGen/MachineOutliner.cpp
llvm/trunk/test/CodeGen/AArch64/machine-outliner.ll
Modified: llvm/trunk/lib/CodeGen/MachineOutliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineOutliner.cpp?rev=332415&r1=332414&r2=332415&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineOutliner.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineOutliner.cpp Tue May 15 16:36:46 2018
@@ -1253,6 +1253,14 @@ MachineOutliner::createOutlinedFunction(
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);
Modified: llvm/trunk/test/CodeGen/AArch64/machine-outliner.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/machine-outliner.ll?rev=332415&r1=332414&r2=332415&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/machine-outliner.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/machine-outliner.ll Tue May 15 16:36:46 2018
@@ -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 @@ define void @dog() #0 {
}
; 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
More information about the llvm-commits
mailing list