mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-22 03:48:57 +00:00
Update getSectionForConstant() to to allow mergable sections to be nulled out
if not supported by the ELF subtarget. llvm-svn: 79249
This commit is contained in:
parent
d65007a4a3
commit
358842178f
@ -609,11 +609,11 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
|
||||
/// 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;
|
||||
|
11
test/CodeGen/XCore/constants.ll
Normal file
11
test/CodeGen/XCore/constants.ll
Normal file
@ -0,0 +1,11 @@
|
||||
; RUN: llvm-as < %s | llc -march=xcore -mcpu=xs1b-generic | FileCheck %s
|
||||
|
||||
; CHECK: .section .cp.rodata,"ac",@progbits
|
||||
; CHECK: .LCPI1_0:
|
||||
; CHECK: .long 12345678
|
||||
; CHECK: f:
|
||||
; CHECK: ldw r0, cp[.LCPI1_0]
|
||||
define i32 @f() {
|
||||
entry:
|
||||
ret i32 12345678
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user