[llvm-commits] [llvm] r79368 - in /llvm/trunk: lib/Target/XCore/XCoreTargetObjectFile.cpp test/CodeGen/XCore/constants.ll test/CodeGen/XCore/globals.ll

Richard Osborne richard at xmos.com
Tue Aug 18 14:14:31 PDT 2009


Author: friedgold
Date: Tue Aug 18 16:14:31 2009
New Revision: 79368

URL: http://llvm.org/viewvc/llvm-project?rev=79368&view=rev
Log:
Add support for mergeable sections back into the XCore backend.

Modified:
    llvm/trunk/lib/Target/XCore/XCoreTargetObjectFile.cpp
    llvm/trunk/test/CodeGen/XCore/constants.ll
    llvm/trunk/test/CodeGen/XCore/globals.ll

Modified: llvm/trunk/lib/Target/XCore/XCoreTargetObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreTargetObjectFile.cpp?rev=79368&r1=79367&r2=79368&view=diff

==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreTargetObjectFile.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreTargetObjectFile.cpp Tue Aug 18 16:14:31 2009
@@ -28,11 +28,24 @@
                            MCSectionXCore::SHF_DP_SECTION,
                            SectionKind::getBSS(), false, getContext());
   
-  // For now, disable lowering of mergable sections, just drop everything into
-  // ReadOnly.
-  MergeableConst4Section = 0;
-  MergeableConst8Section = 0;
-  MergeableConst16Section = 0;
+  MergeableConst4Section = 
+    MCSectionXCore::Create(".cp.rodata.cst4", MCSectionELF::SHT_PROGBITS,
+                           MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_MERGE |
+                           MCSectionXCore::SHF_CP_SECTION,
+                           SectionKind::getMergeableConst4(), false,
+                           getContext());
+  MergeableConst8Section = 
+    MCSectionXCore::Create(".cp.rodata.cst8", MCSectionELF::SHT_PROGBITS,
+                           MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_MERGE |
+                           MCSectionXCore::SHF_CP_SECTION,
+                           SectionKind::getMergeableConst8(), false,
+                           getContext());
+  MergeableConst16Section = 
+    MCSectionXCore::Create(".cp.rodata.cst16", MCSectionELF::SHT_PROGBITS,
+                           MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_MERGE |
+                           MCSectionXCore::SHF_CP_SECTION,
+                           SectionKind::getMergeableConst16(), false,
+                           getContext());
   
   // TLS globals are lowered in the backend to arrays indexed by the current
   // thread id. After lowering they require no special handling by the linker

Modified: llvm/trunk/test/CodeGen/XCore/constants.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/XCore/constants.ll?rev=79368&r1=79367&r2=79368&view=diff

==============================================================================
--- llvm/trunk/test/CodeGen/XCore/constants.ll (original)
+++ llvm/trunk/test/CodeGen/XCore/constants.ll Tue Aug 18 16:14:31 2009
@@ -1,6 +1,6 @@
 ; RUN: llvm-as < %s | llc -march=xcore -mcpu=xs1b-generic | FileCheck %s
 
-; CHECK: .section .cp.rodata,"ac", at progbits
+; CHECK: .section .cp.rodata.cst4,"aMc", at progbits,4
 ; CHECK: .LCPI1_0:
 ; CHECK: .long 12345678
 ; CHECK: f:

Modified: llvm/trunk/test/CodeGen/XCore/globals.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/XCore/globals.ll?rev=79368&r1=79367&r2=79368&view=diff

==============================================================================
--- llvm/trunk/test/CodeGen/XCore/globals.ll (original)
+++ llvm/trunk/test/CodeGen/XCore/globals.ll Tue Aug 18 16:14:31 2009
@@ -68,7 +68,7 @@
 ; CHECK: G2:
 
 @G3 = constant i32 9401
-; CHECK: .section .cp.rodata,"ac", at progbits
+; CHECK: .section .cp.rodata.cst4,"aMc", at progbits,4
 ; CHECK: G3:
 
 @G4 = global i32* @G1





More information about the llvm-commits mailing list