[llvm-commits] [llvm] r53034 - /llvm/trunk/lib/Transforms/Scalar/ADCE.cpp

Owen Anderson resistor at mac.com
Wed Jul 2 10:32:04 PDT 2008


Author: resistor
Date: Wed Jul  2 12:32:04 2008
New Revision: 53034

URL: http://llvm.org/viewvc/llvm-project?rev=53034&view=rev
Log:
Use DenseSet rather than SmallPtrSet for the alive set.  Using SmallPtrSet
with a huge "size" parameter is actually quite inefficient.

Modified:
    llvm/trunk/lib/Transforms/Scalar/ADCE.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/ADCE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ADCE.cpp?rev=53034&r1=53033&r2=53034&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ADCE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ADCE.cpp Wed Jul  2 12:32:04 2008
@@ -21,7 +21,7 @@
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/InstIterator.h"
 #include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/SmallVector.h"
 
 using namespace llvm;
@@ -33,7 +33,7 @@
     static char ID; // Pass identification, replacement for typeid
     ADCE() : FunctionPass((intptr_t)&ID) {}
     
-    SmallPtrSet<Instruction*, 1024> alive;
+    DenseSet<Instruction*> alive;
     SmallVector<Instruction*, 1024> worklist;
     
     virtual bool runOnFunction(Function& F);





More information about the llvm-commits mailing list