-//===- FastDSE.cpp - Fast Dead Store Elimination --------------------------===//
+//===- DeadStoreElimination.cpp - Fast Dead Store Elimination --------------===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "fdse"
+#define DEBUG_TYPE "dse"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/Function.h"
STATISTIC(NumFastOther , "Number of other instrs removed");
namespace {
- struct VISIBILITY_HIDDEN FDSE : public FunctionPass {
+ struct VISIBILITY_HIDDEN DSE : public FunctionPass {
static char ID; // Pass identification, replacement for typeid
- FDSE() : FunctionPass((intptr_t)&ID) {}
+ DSE() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F) {
bool Changed = false;
AU.addPreserved<MemoryDependenceAnalysis>();
}
};
- char FDSE::ID = 0;
- RegisterPass<FDSE> X("fdse", "Fast Dead Store Elimination");
+ char DSE::ID = 0;
+ RegisterPass<DSE> X("dse", "Dead Store Elimination");
}
-FunctionPass *llvm::createFastDeadStoreEliminationPass() { return new FDSE(); }
+FunctionPass *llvm::createDeadStoreEliminationPass() { return new DSE(); }
-bool FDSE::runOnBasicBlock(BasicBlock &BB) {
+bool DSE::runOnBasicBlock(BasicBlock &BB) {
MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
// Record the last-seen store to this pointer
/// handleFreeWithNonTrivialDependency - Handle frees of entire structures whose
/// dependency is a store to a field of that structure
-bool FDSE::handleFreeWithNonTrivialDependency(FreeInst* F, Instruction* dep,
+bool DSE::handleFreeWithNonTrivialDependency(FreeInst* F, Instruction* dep,
SetVector<Instruction*>& possiblyDead) {
TargetData &TD = getAnalysis<TargetData>();
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
/// handleEndBlock - Remove dead stores to stack-allocated locations in the function
/// end block
-bool FDSE::handleEndBlock(BasicBlock& BB, SetVector<Instruction*>& possiblyDead) {
+bool DSE::handleEndBlock(BasicBlock& BB, SetVector<Instruction*>& possiblyDead) {
TargetData &TD = getAnalysis<TargetData>();
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
return MadeChange;
}
-bool FDSE::RemoveUndeadPointers(Value* killPointer, unsigned killPointerSize,
+bool DSE::RemoveUndeadPointers(Value* killPointer, unsigned killPointerSize,
BasicBlock::iterator& BBI,
SmallPtrSet<AllocaInst*, 4>& deadPointers,
SetVector<Instruction*>& possiblyDead) {
return MadeChange;
}
-void FDSE::DeleteDeadInstructionChains(Instruction *I,
+void DSE::DeleteDeadInstructionChains(Instruction *I,
SetVector<Instruction*> &DeadInsts) {
// Instruction must be dead.
if (!I->use_empty() || !isInstructionTriviallyDead(I)) return;
addPass(PM, createInstructionCombiningPass());
addPass(PM, createCondPropagationPass()); // Propagate conditionals
- addPass(PM, createFastDeadStoreEliminationPass()); // Delete dead stores
+ addPass(PM, createDeadStoreEliminationPass()); // Delete dead stores
addPass(PM, createAggressiveDCEPass()); // SSA based 'Aggressive DCE'
addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs
addPass(PM, createSimplifyLibCallsPass()); // Library Call Optimizations