LLVM API Documentation

Defines | Functions | Variables
StackColoring.cpp File Reference
#include "llvm/CodeGen/Passes.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SparseSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
#include "llvm/CodeGen/MachineDominators.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/PseudoSourceValue.h"
#include "llvm/CodeGen/SlotIndexes.h"
#include "llvm/CodeGen/StackProtector.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/MC/MCInstrItineraries.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"
Include dependency graph for StackColoring.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "stackcoloring"

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,"stack-coloring","Merge disjoint stack slots", false, false) INITIALIZE_PASS_END(StackColoring

Variables

static cl::opt< boolDisableColoring ("no-stack-coloring", cl::init(false), cl::Hidden, cl::desc("Disable stack coloring"))
static cl::opt< boolProtectFromEscapedAllocas ("protect-from-escaped-allocas", cl::init(false), cl::Hidden, cl::desc("Do not optimize lifetime zones that ""are broken"))
stack coloring
stack Merge disjoint stack slots
stack Merge disjoint stack false

Define Documentation

#define DEBUG_TYPE   "stackcoloring"

Definition at line 60 of file StackColoring.cpp.


Function Documentation

INITIALIZE_PASS_BEGIN ( StackColoring  ,
"stack-coloring ,
"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"   
)

Variable Documentation

stack coloring

Definition at line 186 of file StackColoring.cpp.

cl::opt<bool> DisableColoring("no-stack-coloring", cl::init(false), cl::Hidden, cl::desc("Disable stack coloring")) [static]
stack Merge disjoint stack false

Definition at line 186 of file StackColoring.cpp.

cl::opt<bool> ProtectFromEscapedAllocas("protect-from-escaped-allocas", cl::init(false), cl::Hidden, cl::desc("Do not optimize lifetime zones that ""are broken")) [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.

stack Merge disjoint stack slots

Definition at line 186 of file StackColoring.cpp.