From f6a05f949f39d94d846dff9bf5093a838c6ebc4b Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Wed, 1 Aug 2007 06:36:51 +0000 Subject: [PATCH] Rename FastDSE to just DSE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40668 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/LinkAllPasses.h | 1 - include/llvm/Transforms/Scalar.h | 7 ------ .../Scalar/DeadStoreElimination.cpp | 24 +++++++++---------- .../2004-11-28-LiveStoreDeleted.ll | 2 +- .../2004-12-28-PartialStore.ll | 2 +- .../DeadStoreElimination/2005-11-30-vaarg.ll | 2 +- .../2006-06-27-AST-Remove.ll | 2 +- .../DeadStoreElimination/PartialStore.ll | 2 +- tools/llvm-ld/Optimize.cpp | 2 +- tools/opt/opt.cpp | 2 +- 10 files changed, 19 insertions(+), 27 deletions(-) diff --git a/include/llvm/LinkAllPasses.h b/include/llvm/LinkAllPasses.h index 1d0925b6bb2..20cf28dd0d8 100644 --- a/include/llvm/LinkAllPasses.h +++ b/include/llvm/LinkAllPasses.h @@ -62,7 +62,6 @@ namespace { (void) llvm::createDeadTypeEliminationPass(); (void) llvm::createEdgeProfilerPass(); (void) llvm::createRedundantLoadEliminationPass(); - (void) llvm::createFastDeadStoreEliminationPass(); (void) llvm::createFunctionInliningPass(); (void) llvm::createFunctionProfilerPass(); (void) llvm::createGCSEPass(); diff --git a/include/llvm/Transforms/Scalar.h b/include/llvm/Transforms/Scalar.h index 196a3f487a7..94ad3764009 100644 --- a/include/llvm/Transforms/Scalar.h +++ b/include/llvm/Transforms/Scalar.h @@ -323,13 +323,6 @@ FunctionPass *createPredicateSimplifierPass(); // FunctionPass *createGVNPREPass(); -//===----------------------------------------------------------------------===// -// -// FastDeadStoreElimination - This pass deletes stores that are post-dominated by -// must-aliased stores and are not loaded used between the stores. -// -FunctionPass *createFastDeadStoreEliminationPass(); - //===----------------------------------------------------------------------===// // // RedundantLoadElimination - This pass deletes loads that are dominated by diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index abc0adec354..0b26a5b65e3 100644 --- a/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -1,4 +1,4 @@ -//===- FastDSE.cpp - Fast Dead Store Elimination --------------------------===// +//===- DeadStoreElimination.cpp - Fast Dead Store Elimination --------------===// // // The LLVM Compiler Infrastructure // @@ -15,7 +15,7 @@ // //===----------------------------------------------------------------------===// -#define DEBUG_TYPE "fdse" +#define DEBUG_TYPE "dse" #include "llvm/Transforms/Scalar.h" #include "llvm/Constants.h" #include "llvm/Function.h" @@ -35,9 +35,9 @@ STATISTIC(NumFastStores, "Number of stores deleted"); 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; @@ -78,13 +78,13 @@ namespace { AU.addPreserved(); } }; - char FDSE::ID = 0; - RegisterPass X("fdse", "Fast Dead Store Elimination"); + char DSE::ID = 0; + RegisterPass 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(); // Record the last-seen store to this pointer @@ -172,7 +172,7 @@ bool FDSE::runOnBasicBlock(BasicBlock &BB) { /// 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& possiblyDead) { TargetData &TD = getAnalysis(); AliasAnalysis &AA = getAnalysis(); @@ -213,7 +213,7 @@ bool FDSE::handleFreeWithNonTrivialDependency(FreeInst* F, Instruction* dep, /// handleEndBlock - Remove dead stores to stack-allocated locations in the function /// end block -bool FDSE::handleEndBlock(BasicBlock& BB, SetVector& possiblyDead) { +bool DSE::handleEndBlock(BasicBlock& BB, SetVector& possiblyDead) { TargetData &TD = getAnalysis(); AliasAnalysis &AA = getAnalysis(); MemoryDependenceAnalysis& MD = getAnalysis(); @@ -309,7 +309,7 @@ bool FDSE::handleEndBlock(BasicBlock& BB, SetVector& possiblyDead) return MadeChange; } -bool FDSE::RemoveUndeadPointers(Value* killPointer, unsigned killPointerSize, +bool DSE::RemoveUndeadPointers(Value* killPointer, unsigned killPointerSize, BasicBlock::iterator& BBI, SmallPtrSet& deadPointers, SetVector& possiblyDead) { @@ -363,7 +363,7 @@ bool FDSE::RemoveUndeadPointers(Value* killPointer, unsigned killPointerSize, return MadeChange; } -void FDSE::DeleteDeadInstructionChains(Instruction *I, +void DSE::DeleteDeadInstructionChains(Instruction *I, SetVector &DeadInsts) { // Instruction must be dead. if (!I->use_empty() || !isInstructionTriviallyDead(I)) return; diff --git a/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll b/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll index d1f80430c0e..36afb24ff36 100644 --- a/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll +++ b/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -fdse -scalarrepl -instcombine | \ +; RUN: llvm-upgrade < %s | llvm-as | opt -dse -scalarrepl -instcombine | \ ; RUN: llvm-dis | not grep {ret int undef} int %test(double %__x) { diff --git a/test/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll b/test/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll index 04534cd69ae..ec48e46a71e 100644 --- a/test/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll +++ b/test/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -fdse | llvm-dis | \ +; RUN: llvm-upgrade < %s | llvm-as | opt -dse | llvm-dis | \ ; RUN: grep {store i32 1234567} ; Do not delete stores that are only partially killed. diff --git a/test/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll b/test/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll index 69cd7aa59a7..58b253c9f4a 100644 --- a/test/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll +++ b/test/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -fdse | llvm-dis | grep store +; RUN: llvm-upgrade < %s | llvm-as | opt -dse | llvm-dis | grep store double %foo(sbyte* %X) { %X_addr = alloca sbyte* diff --git a/test/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll b/test/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll index 948f5fd5352..5deaef46081 100644 --- a/test/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll +++ b/test/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalsmodref-aa -fdse -disable-output +; RUN: llvm-upgrade < %s | llvm-as | opt -globalsmodref-aa -dse -disable-output target endian = big target pointersize = 32 target triple = "powerpc-apple-darwin8" diff --git a/test/Transforms/DeadStoreElimination/PartialStore.ll b/test/Transforms/DeadStoreElimination/PartialStore.ll index b8122516dd1..bdc16dbcb8c 100644 --- a/test/Transforms/DeadStoreElimination/PartialStore.ll +++ b/test/Transforms/DeadStoreElimination/PartialStore.ll @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -fdse | llvm-dis | \ +; RUN: llvm-upgrade < %s | llvm-as | opt -dse | llvm-dis | \ ; RUN: not grep {store sbyte} ; Ensure that the dead store is deleted in this case. It is wholely ; overwritten by the second store. diff --git a/tools/llvm-ld/Optimize.cpp b/tools/llvm-ld/Optimize.cpp index 308fd546e3a..49b8f4225bc 100644 --- a/tools/llvm-ld/Optimize.cpp +++ b/tools/llvm-ld/Optimize.cpp @@ -168,7 +168,7 @@ void Optimize(Module* M) { addPass(Passes, createLICMPass()); // Hoist loop invariants addPass(Passes, createLoadValueNumberingPass()); // GVN for load instrs addPass(Passes, createGCSEPass()); // Remove common subexprs - addPass(Passes, createFastDeadStoreEliminationPass()); // Nuke dead stores + addPass(Passes, createDeadStoreEliminationPass()); // Nuke dead stores // Cleanup and simplify the code after the scalar optimizations. addPass(Passes, createInstructionCombiningPass()); diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 7847b77ae71..4eca3084257 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -290,7 +290,7 @@ void AddStandardCompilePasses(PassManager &PM) { 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 -- 2.34.1