Remove incomplete cost analysis.
[oota-llvm.git] / lib / Transforms / Scalar / RedundantLoadElimination.cpp
index 74712ad83fe0f6a41c1aa0f232f4c5b73e78d3b8..3b719df4f6e33314729260cb658c57738641d3f4 100644 (file)
@@ -15,7 +15,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "fdle"
+#define DEBUG_TYPE "rle"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Function.h"
 #include "llvm/Instructions.h"
@@ -30,9 +30,9 @@ using namespace llvm;
 STATISTIC(NumFastLoads, "Number of loads deleted");
 
 namespace {
-  struct VISIBILITY_HIDDEN FDLE : public FunctionPass {
+  struct VISIBILITY_HIDDEN RLE : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    FDLE() : FunctionPass((intptr_t)&ID) {}
+    RLE() : FunctionPass((intptr_t)&ID) {}
 
     virtual bool runOnFunction(Function &F) {
       bool Changed = false;
@@ -51,13 +51,13 @@ namespace {
       AU.addPreserved<MemoryDependenceAnalysis>();
     }
   };
-  char FDLE::ID = 0;
-  RegisterPass<FDLE> X("fdle", "Fast Dead Load Elimination");
+  char RLE::ID = 0;
+  RegisterPass<RLE> X("rle", "Redundant Load Elimination");
 }
 
-FunctionPass *llvm::createFastDeadLoadEliminationPass() { return new FDLE(); }
+FunctionPass *llvm::createRedundantLoadEliminationPass() { return new RLE(); }
 
-bool FDLE::runOnBasicBlock(BasicBlock &BB) {
+bool RLE::runOnBasicBlock(BasicBlock &BB) {
   MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
   
   // Record the last-seen load from this pointer
@@ -66,7 +66,8 @@ bool FDLE::runOnBasicBlock(BasicBlock &BB) {
   bool MadeChange = false;
   
   // Do a top-down walk on the BB
-  for (BasicBlock::iterator BBI = BB.begin(), BBE = BB.end(); BBI != BBE; ++BBI) {
+  for (BasicBlock::iterator BBI = BB.begin(), BBE = BB.end(); 
+       BBI != BBE; ++BBI) {
     // If we find a store or a free...
     if (LoadInst* L = dyn_cast<LoadInst>(BBI)) {
       // We can't delete volatile loads