[PATCH] D46091: [MachineOutliner] Don't outline from functions with a section marking.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 26 17:25:08 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL331007: [MachineOutliner] Don't outline from functions with a section marking. (authored by efriedma, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D46091?vs=144030&id=144254#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D46091

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


Index: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
===================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -4989,6 +4989,13 @@
   if (!OutlineFromLinkOnceODRs && F.hasLinkOnceODRLinkage())
     return false;
 
+  // Don't outline from functions with section markings; the program could
+  // expect that all the code is in the named section.
+  // FIXME: Allow outlining from multiple functions with the same section
+  // marking.
+  if (F.hasSection())
+    return false;
+
   // Outlining from functions with redzones is unsafe since the outliner may
   // modify the stack. Check if hasRedZone is true or unknown; if yes, don't
   // outline from it.
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
@@ -17,6 +17,21 @@
   ret void
 }
 
+define void @turtle() section "TURTLE,turtle" {
+  ; CHECK-LABEL: _turtle:
+  ; ODR-LABEL: _turtle:
+  ; CHECK-NOT: OUTLINED
+  %1 = alloca i32, align 4
+  %2 = alloca i32, align 4
+  %3 = alloca i32, align 4
+  %4 = alloca i32, align 4
+  store i32 0, i32* %1, align 4
+  store i32 1, i32* %2, align 4
+  store i32 2, i32* %3, align 4
+  store i32 3, i32* %4, align 4
+  ret void
+}
+
 define void @cat() #0 {
   ; CHECK-LABEL: _cat:
   ; CHECK: [[OUTLINED:OUTLINED_FUNCTION_[0-9]+]]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46091.144254.patch
Type: text/x-patch
Size: 1548 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180427/8d063367/attachment.bin>


More information about the llvm-commits mailing list