[PATCH] D17555: [Feedback requested] Implement cold spliting
David Li via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 23 21:26:24 PST 2016
davidxl added a comment.
There are quite a few refactoring changes that can be combined and split out. After that this patch can be minimized and becomes easier to review. Can you do the split first?
David
================
Comment at: lib/CodeGen/AsmPrinter/DwarfCFIException.cpp:46
@@ -45,4 +45,3 @@
void DwarfCFIExceptionBase::markFunctionEnd() {
- if (shouldEmitCFI)
- Asm->OutStreamer->EmitCFIEndProc();
+ endFragment();
----------------
This can be split (with other refactoring changes) into a NFC patch.
================
Comment at: lib/CodeGen/AsmPrinter/DwarfCFIException.cpp:138
@@ +137,3 @@
+///
+void DwarfCFIException::endFunction(const MachineFunction *) {
+ assert(InFlightCFIs.empty() && "Remaining inflight CFI");
----------------
Is it necessary to move this function above here? seems like an irrelevant change.
================
Comment at: lib/CodeGen/AsmPrinter/DwarfCFIException.cpp:147
@@ -147,3 +146,3 @@
- // Provide LSDA information.
- if (!shouldEmitLSDA)
+void DwarfCFIException::beginFragment(const MachineBasicBlock *MBB,
+ ExceptionSymbolProvider ESP) {
----------------
Another candidate of NFC refactoring.
================
Comment at: lib/MC/MCObjectFileInfo.cpp:78
@@ -77,1 +77,3 @@
SectionKind::getText());
+ ColdTextSection // .text.cold
+ = Ctx->getMachOSection("__TEXT", "__text.cold",
----------------
Should this section be created on demand when getColdTextSection() is called?
================
Comment at: lib/MC/MCObjectFileInfo.cpp:448
@@ -443,1 +447,3 @@
+ ColdTextSection = Ctx->getELFSection(".text.cold", ELF::SHT_PROGBITS,
+ ELF::SHF_EXECINSTR | ELF::SHF_ALLOC);
----------------
use .text.unlikely to be consistent with the name used in function reordering.
================
Comment at: lib/MC/MCStreamer.cpp:258
@@ -240,5 +257,3 @@
void MCStreamer::EmitCFIStartProc(bool IsSimple) {
- MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
- if (CurFrame && !CurFrame->End)
- report_fatal_error("Starting a frame before finishing the previous one!");
+ assert(!hasUnfinishedDwarfFrameInfo() && "Starting a frame before finishing the previous one!");
----------------
This refactor change can go in its own patch. Also this change is not NFC -- the original code report fatal error regardless of whether NDEBUG is defined or not.
================
Comment at: test/CodeGen/X86/coldsplit.ll:1
@@ +1,2 @@
+; RUN: llc -split-cold-code < %s | FileCheck %s
+
----------------
need mtriple (either linux or darwin) -- this does not work on COFF yet.
http://reviews.llvm.org/D17555
More information about the llvm-commits
mailing list