|
LLVM
5.0.0
|
#include "llvm/ADT/BitVector.h"#include "llvm/ADT/DepthFirstIterator.h"#include "llvm/ADT/SetVector.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/CodeGen/LiveInterval.h"#include "llvm/CodeGen/MachineBasicBlock.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineFunctionPass.h"#include "llvm/CodeGen/MachineLoopInfo.h"#include "llvm/CodeGen/MachineMemOperand.h"#include "llvm/CodeGen/MachineModuleInfo.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/CodeGen/Passes.h"#include "llvm/CodeGen/PseudoSourceValue.h"#include "llvm/CodeGen/SelectionDAGNodes.h"#include "llvm/CodeGen/SlotIndexes.h"#include "llvm/CodeGen/StackProtector.h"#include "llvm/CodeGen/WinEHFuncInfo.h"#include "llvm/IR/DebugInfo.h"#include "llvm/IR/Function.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Module.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Target/TargetInstrInfo.h"#include "llvm/Target/TargetRegisterInfo.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "stack-coloring" |
Functions | |
| STATISTIC (NumMarkerSeen,"Number of lifetime markers found.") | |
| STATISTIC (StackSpaceSaved,"Number of bytes saved due to merging slots.") | |
| STATISTIC (StackSlotMerged,"Number of stack slot merged.") | |
| STATISTIC (EscapedAllocas,"Number of allocas that escaped the lifetime region") | |
| INITIALIZE_PASS_BEGIN (StackColoring, DEBUG_TYPE,"Merge disjoint stack slots", false, false) INITIALIZE_PASS_END(StackColoring | |
| static int | getStartOrEndSlot (const MachineInstr &MI) |
Variables | |
| static cl::opt< bool > | DisableColoring ("no-stack-coloring", cl::init(false), cl::Hidden, cl::desc("Disable stack coloring")) |
| static cl::opt< bool > | ProtectFromEscapedAllocas ("protect-from-escaped-allocas", cl::init(false), cl::Hidden, cl::desc("Do not optimize lifetime zones that ""are broken")) |
| The user may write code that uses allocas outside of the declared lifetime zone. More... | |
| static cl::opt< bool > | LifetimeStartOnFirstUse ("stackcoloring-lifetime-start-on-first-use", cl::init(true), cl::Hidden, cl::desc("Treat stack lifetimes as starting on first use, not on START marker.")) |
| Enable enhanced dataflow scheme for lifetime analysis (treat first use of stack slot as start of slot lifetime, as opposed to looking for LIFETIME_START marker). More... | |
| DEBUG_TYPE | |
| Merge disjoint stack | slots |
| Merge disjoint stack | false |
| #define DEBUG_TYPE "stack-coloring" |
Definition at line 57 of file StackColoring.cpp.
|
inlinestatic |
Definition at line 550 of file StackColoring.cpp.
References assert(), llvm::MachineOperand::getIndex(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::ISD::LIFETIME_END, and llvm::ISD::LIFETIME_START.
| INITIALIZE_PASS_BEGIN | ( | StackColoring | , |
| DEBUG_TYPE | , | ||
| "Merge disjoint stack slots" | , | ||
| false | , | ||
| false | |||
| ) |
| STATISTIC | ( | NumMarkerSeen | , |
| "Number of lifetime markers found." | |||
| ) |
| STATISTIC | ( | StackSpaceSaved | , |
| "Number of bytes saved due to merging slots." | |||
| ) |
| STATISTIC | ( | StackSlotMerged | , |
| "Number of stack slot merged." | |||
| ) |
| STATISTIC | ( | EscapedAllocas | , |
| "Number of allocas that escaped the lifetime region" | |||
| ) |
| DEBUG_TYPE |
Definition at line 505 of file StackColoring.cpp.
|
static |
| Merge disjoint stack false |
Definition at line 505 of file StackColoring.cpp.
|
static |
Enable enhanced dataflow scheme for lifetime analysis (treat first use of stack slot as start of slot lifetime, as opposed to looking for LIFETIME_START marker).
See "Implementation notes" below for more info.
|
static |
The user may write code that uses allocas outside of the declared lifetime zone.
This can happen when the user returns a reference to a local data-structure. We can detect these cases and decide not to optimize the code. If this flag is enabled, we try to save the user. This option is treated as overriding LifetimeStartOnFirstUse below.
| Merge disjoint stack slots |
Definition at line 505 of file StackColoring.cpp.
1.8.6