diff options
author | Sriraman Tallam <tmsriram@google.com> | 2020-03-16 15:56:02 -0700 |
---|---|---|
committer | Sriraman Tallam <tmsriram@google.com> | 2020-03-16 16:06:54 -0700 |
commit | df082ac45aa034b8b5194123035554a93ed6d38e (patch) | |
tree | c48dfbcf08328371ef2bbb7c822305fb39d754f3 /llvm/lib/CodeGen/MIRPrinter.cpp | |
parent | 30dc342f084d5ca9cd4ba9f8a7de37a783c8687e (diff) | |
download | llvm-df082ac45aa034b8b5194123035554a93ed6d38e.zip llvm-df082ac45aa034b8b5194123035554a93ed6d38e.tar.gz llvm-df082ac45aa034b8b5194123035554a93ed6d38e.tar.bz2 |
Basic Block Sections support in LLVM.
This is the second patch in a series of patches to enable basic block
sections support.
This patch adds support for:
* Creating direct jumps at the end of basic blocks that have fall
through instructions.
* New pass, bbsections-prepare, that analyzes placement of basic blocks
in sections.
* Actual placing of a basic block in a unique section with special
handling of exception handling blocks.
* Supports placing a subset of basic blocks in a unique section.
* Support for MIR serialization and deserialization with basic block
sections.
Parent patch : D68063
Differential Revision: https://reviews.llvm.org/D73674
Diffstat (limited to 'llvm/lib/CodeGen/MIRPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MIRPrinter.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index ece4f96..1fb557e 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -635,6 +635,27 @@ void MIPrinter::print(const MachineBasicBlock &MBB) { OS << "align " << MBB.getAlignment().value(); HasAttributes = true; } + if (MBB.getSectionType() != MBBS_None) { + OS << (HasAttributes ? ", " : " ("); + OS << "bbsections "; + switch (MBB.getSectionType()) { + case MBBS_Entry: + OS << "Entry"; + break; + case MBBS_Exception: + OS << "Exception"; + break; + case MBBS_Cold: + OS << "Cold"; + break; + case MBBS_Unique: + OS << "Unique"; + break; + default: + llvm_unreachable("No such section type"); + } + HasAttributes = true; + } if (HasAttributes) OS << ")"; OS << ":\n"; |