Don't put integer pointers (longs) into the scalar map.
authorChris Lattner <sabre@nondot.org>
Fri, 14 Feb 2003 04:55:58 +0000 (04:55 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 14 Feb 2003 04:55:58 +0000 (04:55 +0000)
This speeds stuff up by 10% on some tests, woot!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5564 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/Local.cpp

index 32d7aea42faff3b8d77af6cc65db1ff2191985a6..ffc80e73a6a4920196df04ad3958f76c145c2d57 100644 (file)
@@ -143,6 +143,16 @@ DSGraph::DSGraph(Function &F, DSGraph *GG) : Func(&F), GlobalsGraph(GG) {
 #ifndef NDEBUG
   Timer::addPeakMemoryMeasurement();
 #endif
+
+  // Remove all integral constants from the scalarmap!
+  for (hash_map<Value*, DSNodeHandle>::iterator I = ScalarMap.begin();
+       I != ScalarMap.end();)
+    if (isa<ConstantIntegral>(I->first)) {
+      hash_map<Value*, DSNodeHandle>::iterator J = I++;
+      ScalarMap.erase(J);
+    } else
+      ++I;
+
   markIncompleteNodes(DSGraph::MarkFormalArgs);
 
   // Remove any nodes made dead due to merging...