|
LLVM
5.0.0
|
Replaces repeated sequences of instructions with function calls. More...
#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/Twine.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/CodeGen/MachineModuleInfo.h"#include "llvm/CodeGen/Passes.h"#include "llvm/IR/IRBuilder.h"#include "llvm/Support/Allocator.h"#include "llvm/Support/Debug.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Target/TargetInstrInfo.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Target/TargetRegisterInfo.h"#include "llvm/Target/TargetSubtargetInfo.h"#include <functional>#include <map>#include <sstream>#include <tuple>#include <vector>Go to the source code of this file.
Namespaces | |
| llvm | |
| Compute iterated dominance frontiers using a linear time algorithm. | |
Macros | |
| #define | DEBUG_TYPE "machine-outliner" |
Functions | |
| STATISTIC (NumOutlined,"Number of candidates outlined") | |
| STATISTIC (FunctionsCreated,"Number of functions created") | |
| ModulePass * | llvm::createMachineOutlinerPass () |
| This pass performs outlining on machine instructions directly before printing assembly. More... | |
| INITIALIZE_PASS (MachineOutliner, DEBUG_TYPE,"Machine Function Outliner", false, false) void MachineOutliner | |
Replaces repeated sequences of instructions with function calls.
This works by placing every instruction from every basic block in a suffix tree, and repeatedly querying that tree for repeated sequences of instructions. If a sequence of instructions appears often, then it ought to be beneficial to pull out into a function.
This was originally presented at the 2016 LLVM Developers' Meeting in the talk "Reducing Code Size Using Outlining". For a high-level overview of how this pass works, the talk is available on YouTube at
https://www.youtube.com/watch?v=yorld-WSOeU
The slides for the talk are available at
http://www.llvm.org/devmtg/2016-11/Slides/Paquette-Outliner.pdf
The talk provides an overview of how the outliner finds candidates and ultimately outlines them. It describes how the main data structure for this pass, the suffix tree, is queried and purged for candidates. It also gives a simplified suffix tree construction algorithm for suffix trees based off of the algorithm actually used here, Ukkonen's algorithm.
For the original RFC for this pass, please see
http://lists.llvm.org/pipermail/llvm-dev/2016-August/104170.html
For more information on the suffix tree data structure, please see https://www.cs.helsinki.fi/u/ukkonen/SuffixT1withFigs.pdf
Definition in file MachineOutliner.cpp.
| #define DEBUG_TYPE "machine-outliner" |
Definition at line 64 of file MachineOutliner.cpp.
| INITIALIZE_PASS | ( | MachineOutliner | , |
| DEBUG_TYPE | , | ||
| "Machine Function Outliner" | , | ||
| false | , | ||
| false | |||
| ) |
Definition at line 904 of file MachineOutliner.cpp.
References assert(), llvm::dbgs(), and DEBUG.
| STATISTIC | ( | NumOutlined | , |
| "Number of candidates outlined" | |||
| ) |
| STATISTIC | ( | FunctionsCreated | , |
| "Number of functions created" | |||
| ) |
1.8.6