Switch a worklist in CodeGenPrepare to SmallVector and increase the inline
authorCameron Zwarich <zwarich@apple.com>
Mon, 3 Jan 2011 06:33:01 +0000 (06:33 +0000)
committerCameron Zwarich <zwarich@apple.com>
Mon, 3 Jan 2011 06:33:01 +0000 (06:33 +0000)
capacity on the Visited SmallPtrSet. On 403.gcc, this is about a 4.5% speedup of
CodeGenPrepare time (which itself is 10% of time spent in the backend).

This is progress towards PR8889.

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

lib/Transforms/Scalar/CodeGenPrepare.cpp

index 1f0930df06ca5d02d1dac493a45e8ab8189c59eb..f4edcc76ec532620e043852b56802ebb01495da7 100644 (file)
@@ -623,8 +623,8 @@ bool CodeGenPrepare::OptimizeMemoryInst(Instruction *MemoryInst, Value *Addr,
   
   // Try to collapse single-value PHI nodes.  This is necessary to undo 
   // unprofitable PRE transformations.
-  std::vector<Value*> worklist;
-  SmallPtrSet<Value*, 4> Visited;
+  SmallVector<Value*, 8> worklist;
+  SmallPtrSet<Value*, 16> Visited;
   worklist.push_back(Addr);
   
   // Use a worklist to iteratively look through PHI nodes, and ensure that