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/Target/TargetLoweringObjectFile.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/Target/TargetLoweringObjectFile.cpp')
-rw-r--r-- | llvm/lib/Target/TargetLoweringObjectFile.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp index cfdb675..9f464c0 100644 --- a/llvm/lib/Target/TargetLoweringObjectFile.cpp +++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp @@ -149,6 +149,10 @@ SectionKind TargetLoweringObjectFile::getKindForGlobal(const GlobalObject *GO, if (isa<Function>(GO)) return SectionKind::getText(); + // Basic blocks are classified as text sections. + if (isa<BasicBlock>(GO)) + return SectionKind::getText(); + // Global variables require more detailed analysis. const auto *GVar = cast<GlobalVariable>(GO); @@ -302,6 +306,18 @@ MCSection *TargetLoweringObjectFile::getSectionForConstant( return DataSection; } +MCSection *TargetLoweringObjectFile::getSectionForMachineBasicBlock( + const Function &F, const MachineBasicBlock &MBB, + const TargetMachine &TM) const { + return nullptr; +} + +MCSection *TargetLoweringObjectFile::getNamedSectionForMachineBasicBlock( + const Function &F, const MachineBasicBlock &MBB, const TargetMachine &TM, + const char *Suffix) const { + return nullptr; +} + /// getTTypeGlobalReference - Return an MCExpr to use for a /// reference to the specified global variable from exception /// handling information. |