[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp

Jim Laskey jlaskey at apple.com
Tue Nov 28 10:22:06 PST 2006



Changes in directory llvm/lib/Target/PowerPC:

PPCAsmPrinter.cpp updated: 1.210 -> 1.211
---
Log message:

Prime text sections to improve branch locality in large object files.

---
Diffs of the changes:  (+13 -0)

 PPCAsmPrinter.cpp |   13 +++++++++++++
 1 files changed, 13 insertions(+)


Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.210 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.211
--- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.210	Fri Nov 17 19:23:56 2006
+++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp	Tue Nov 28 12:21:52 2006
@@ -543,6 +543,19 @@
   // Darwin wants symbols to be quoted if they have complex names.
   Mang->setUseQuotes(true);
   
+  // Prime text sections so they are adjacent.  This reduces the likelihood a
+  // large data or debug section causes a branch to exceed 16M limit.
+  SwitchToTextSection(".section __TEXT,__textcoal_nt,coalesced,"
+                      "pure_instructions");
+  if (TM.getRelocationModel() == Reloc::PIC_) {
+    SwitchToTextSection(".section __TEXT,__picsymbolstub1,symbol_stubs,"
+                          "pure_instructions,32");
+  } else if (TM.getRelocationModel() == Reloc::DynamicNoPIC) {
+    SwitchToTextSection(".section __TEXT,__symbol_stub1,symbol_stubs,"
+                        "pure_instructions,16");
+  }
+  SwitchToTextSection(TAI->getTextSection());
+  
   // Emit initial debug information.
   DW.BeginModule(&M);
   return false;






More information about the llvm-commits mailing list