LLVM API Documentation
#include "llvm/Transforms/Utils/PromoteMemToReg.h"#include "llvm/Constants.h"#include "llvm/DerivedTypes.h"#include "llvm/Function.h"#include "llvm/Instructions.h"#include "llvm/IntrinsicInst.h"#include "llvm/LLVMContext.h"#include "llvm/Analysis/Dominators.h"#include "llvm/Analysis/AliasSetTracker.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/STLExtras.h"#include "llvm/Support/CFG.h"#include "llvm/Support/Compiler.h"#include <algorithm>
Go to the source code of this file.
Namespaces | |
| namespace | llvm |
Classes | |
| struct | llvm::DenseMapInfo< std::pair< BasicBlock *, unsigned > > |
Defines | |
| #define | DEBUG_TYPE "mem2reg" |
Functions | |
| STATISTIC (NumLocalPromoted,"Number of alloca's promoted within one block") | |
| STATISTIC (NumSingleStore,"Number of alloca's promoted with a single store") | |
| STATISTIC (NumDeadAlloca,"Number of dead alloca's removed") | |
| STATISTIC (NumPHIInsert,"Number of PHI nodes inserted") | |
| bool | llvm::isAllocaPromotable (const AllocaInst *AI) |
| void | llvm::PromoteMemToReg (const std::vector< AllocaInst * > &Allocas, DominatorTree &DT, DominanceFrontier &DF, LLVMContext &Context, AliasSetTracker *AST=0) |
| #define DEBUG_TYPE "mem2reg" |
Definition at line 19 of file PromoteMemoryToRegister.cpp.
| STATISTIC | ( | NumPHIInsert | , | |
| "Number of PHI nodes inserted" | ||||
| ) |
| STATISTIC | ( | NumDeadAlloca | , | |
| "Number of dead alloca's removed" | ||||
| ) |
| STATISTIC | ( | NumSingleStore | , | |
| "Number of alloca's promoted with a single store" | ||||
| ) |
| STATISTIC | ( | NumLocalPromoted | , | |
| "Number of alloca's promoted within one block" | ||||
| ) |
| std::map<AllocaInst*, unsigned> AllocaLookup |
AllocaLookup - Reverse mapping of Allocas.
Definition at line 189 of file PromoteMemoryToRegister.cpp.
Definition at line 278 of file PromoteMemoryToRegister.cpp.
| std::vector<AllocaInst*> Allocas |
Allocas - The alloca instructions being promoted.
Definition at line 177 of file PromoteMemoryToRegister.cpp.
AST - An AliasSetTracker object to update. If null, don't update it.
Definition at line 183 of file PromoteMemoryToRegister.cpp.
Definition at line 111 of file PromoteMemoryToRegister.cpp.
BBNumbers - Contains a stable numbering of basic blocks to avoid non-determinstic behavior.
Definition at line 211 of file PromoteMemoryToRegister.cpp.
| DenseMap<const BasicBlock*, unsigned> BBNumPreds |
BBNumPreds - Lazily compute the number of predecessors a block has.
Definition at line 214 of file PromoteMemoryToRegister.cpp.
Definition at line 185 of file PromoteMemoryToRegister.cpp.
| std::vector<BasicBlock*> DefiningBlocks |
Definition at line 271 of file PromoteMemoryToRegister.cpp.
Definition at line 179 of file PromoteMemoryToRegister.cpp.
Definition at line 178 of file PromoteMemoryToRegister.cpp.
| DenseMap<const Instruction *, unsigned> InstNumbers |
InstNumbers - For each instruction that we track, keep the index of the instruction. The index starts out as the number of the instruction from the start of the block.
Definition at line 131 of file PromoteMemoryToRegister.cpp.
| DenseMap<std::pair<BasicBlock*, unsigned>, PHINode*> NewPhiNodes |
NewPhiNodes - The PhiNodes we're adding.
Definition at line 193 of file PromoteMemoryToRegister.cpp.
Definition at line 275 of file PromoteMemoryToRegister.cpp.
Definition at line 274 of file PromoteMemoryToRegister.cpp.
Definition at line 276 of file PromoteMemoryToRegister.cpp.
PhiToAllocaMap - For each PHI node, keep track of which entry in Allocas it corresponds to.
Definition at line 197 of file PromoteMemoryToRegister.cpp.
| std::vector<Value*> PointerAllocaValues |
PointerAllocaValues - If we are updating an AliasSetTracker, then for each alloca that is of pointer type, we keep track of what to copyValue to the inserted PHI nodes here.
Definition at line 203 of file PromoteMemoryToRegister.cpp.
Definition at line 112 of file PromoteMemoryToRegister.cpp.
Referenced by llvm::CloneAndPruneFunctionInto(), llvm::ARMBaseInstrInfo::convertToThreeAddress(), llvm::ARMBaseRegisterInfo::eliminateCallFramePseudoInstr(), llvm::ARMBaseRegisterInfo::eliminateFrameIndex(), emitSPUpdate(), llvm::ARMBaseInstrInfo::foldMemoryOperandImpl(), FoldTwoEntryPHINode(), FoldValueComparisonIntoPredecessors(), getOptionPred(), llvm::MachineBasicBlock::isOnlyReachableByFallthrough(), llvm::LiveVariables::MarkVirtRegAliveInBlock(), and llvm::SimplifyCFG().
| std::vector<BasicBlock*> UsingBlocks |
Definition at line 272 of file PromoteMemoryToRegister.cpp.
| ValVector Values |
Definition at line 113 of file PromoteMemoryToRegister.cpp.
| SmallPtrSet<BasicBlock*, 16> Visited |
Visited - The set of basic blocks the renamer has already visited.
Definition at line 207 of file PromoteMemoryToRegister.cpp.
Referenced by llvm::Compress(), llvm::FindFunctionBackedges(), llvm::MemoryDependenceAnalysis::getNonLocalCallDependency(), llvm::MemoryDependenceAnalysis::getNonLocalPointerDependency(), isNonImmUse(), llvm::SDNode::isPredecessorOf(), isTrivialLoopExitBlock(), llvm::PointerMayBeCaptured(), llvm::LiveIntervals::processImplicitDefs(), llvm::GlobalAlias::resolveAliasedGlobal(), and llvm::LiveVariables::runOnMachineFunction().