[llvm-commits] [llvm] r79249 - in /llvm/trunk: lib/Target/TargetLoweringObjectFile.cpp test/CodeGen/XCore/constants.ll

Richard Osborne richard at xmos.com
Mon Aug 17 09:37:11 PDT 2009


Author: friedgold
Date: Mon Aug 17 11:37:11 2009
New Revision: 79249

URL: http://llvm.org/viewvc/llvm-project?rev=79249&view=rev
Log:
Update getSectionForConstant() to to allow mergable sections to be nulled out
if not supported by the ELF subtarget.

Added:
    llvm/trunk/test/CodeGen/XCore/constants.ll
Modified:
    llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp

Modified: llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp?rev=79249&r1=79248&r2=79249&view=diff

==============================================================================
--- llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp (original)
+++ llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp Mon Aug 17 11:37:11 2009
@@ -609,11 +609,11 @@
 /// should be placed in.
 const MCSection *TargetLoweringObjectFileELF::
 getSectionForConstant(SectionKind Kind) const {
-  if (Kind.isMergeableConst4())
+  if (Kind.isMergeableConst4() && MergeableConst4Section)
     return MergeableConst4Section;
-  if (Kind.isMergeableConst8())
+  if (Kind.isMergeableConst8() && MergeableConst8Section)
     return MergeableConst8Section;
-  if (Kind.isMergeableConst16())
+  if (Kind.isMergeableConst16() && MergeableConst16Section)
     return MergeableConst16Section;
   if (Kind.isReadOnly())
     return ReadOnlySection;

Added: llvm/trunk/test/CodeGen/XCore/constants.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/XCore/constants.ll?rev=79249&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/XCore/constants.ll (added)
+++ llvm/trunk/test/CodeGen/XCore/constants.ll Mon Aug 17 11:37:11 2009
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=xcore -mcpu=xs1b-generic | FileCheck %s
+
+; CHECK: .section .cp.rodata,"ac", at progbits
+; CHECK: .LCPI1_0:
+; CHECK: .long 12345678
+; CHECK: f:
+; CHECK: ldw r0, cp[.LCPI1_0]
+define i32 @f() {
+entry:
+	ret i32 12345678
+}





More information about the llvm-commits mailing list