[BOLT] Introduce MCPlus layer

Summary:
Refactor architecture-specific code out of llvm into llvm-bolt.

Introduce MCPlusBuilder, a class that is taking over MCInstrAnalysis
responsibilities, i.e. creating, analyzing, and modifying instructions.
To access the builder use BC->MIB, i.e. substitute MIA with MIB.
MIB is an acronym for MCInstBuilder, that's what MCPlusBuilder used
to be. The name stuck, and I find it better than MPB.

Instructions are still MCInst, and a bunch of BOLT-specific code still
lives in LLVM, but the staff under Target/* is significantly reduced.

(cherry picked from FBD7300101)
This commit is contained in:
Maksim Panchenko
2018-03-09 09:45:13 -08:00
parent 8c16594f2e
commit 48ae32a33b
43 changed files with 6254 additions and 574 deletions

View File

@@ -1,5 +1,6 @@
add_subdirectory(merge-fdata)
add_subdirectory(Passes)
add_subdirectory(Target)
# Get the current git revision for BOLT.
function(get_version ofn)
@@ -47,6 +48,8 @@ add_public_gen_version_target(GenBoltRevision)
set(LLVM_LINK_COMPONENTS
${LLVM_TARGETS_TO_BUILD}
BOLTPasses
BOLTTargetAArch64
BOLTTargetX86
CodeGen
Core
DebugInfoDWARF
@@ -75,6 +78,7 @@ add_llvm_tool(llvm-bolt
DWARFRewriter.cpp
Exceptions.cpp
JumpTable.cpp
MCPlusBuilder.cpp
ProfileReader.cpp
ProfileWriter.cpp
Relocation.cpp