From 23651c5ae02a209ff214e4283dddb5ab65d1003a Mon Sep 17 00:00:00 2001 From: Sean Fertile Date: Fri, 14 May 2021 13:55:13 -0400 Subject: [PowerPC][AIX] Create multiple constant sections. Fixes issue where late materialized constants can be more strictly aligned then their containing csect. Differential Revision: https://reviews.llvm.org/D103103 --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index add34eccc1f3..3383f5a64a5f 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -2414,7 +2414,20 @@ bool TargetLoweringObjectFileXCOFF::shouldPutJumpTableInFunctionSection( MCSection *TargetLoweringObjectFileXCOFF::getSectionForConstant( const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment) const { - //TODO: Enable emiting constant pool to unique sections when we support it. + // TODO: Enable emiting constant pool to unique sections when we support it. + if (Alignment > Align(16)) + report_fatal_error("Alignments greater than 16 not yet supported."); + + if (Alignment == Align(8)) { + assert(ReadOnly8Section && "Section should always be initialized."); + return ReadOnly8Section; + } + + if (Alignment == Align(16)) { + assert(ReadOnly16Section && "Section should always be initialized."); + return ReadOnly16Section; + } + return ReadOnlySection; } -- cgit v1.2.3