[llvm-commits] [llvm] r102009 - /llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
Bob Wilson
bob.wilson at apple.com
Wed Apr 21 11:39:03 PDT 2010
Author: bwilson
Date: Wed Apr 21 13:39:03 2010
New Revision: 102009
URL: http://llvm.org/viewvc/llvm-project?rev=102009&view=rev
Log:
Fix a performance problem with the new SSAUpdater. This showed up in the
GCCAS time for MultiSource/Benchmarks/ASCI_Purple/SMG2000.
Modified:
llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp?rev=102009&r1=102008&r2=102009&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp Wed Apr 21 13:39:03 2010
@@ -529,9 +529,15 @@
E = BlockList->rend(); I != E; ++I) {
BBInfo *Info = *I;
- // Check if this block contains a newly added PHI.
- if (Info->DefBB != Info)
+ if (Info->DefBB != Info) {
+ // Record the available value at join nodes to speed up subsequent
+ // uses of this SSAUpdater for the same value.
+ if (Info->NumPreds > 1)
+ AvailableVals[Info->BB] = Info->DefBB->AvailableVal;
continue;
+ }
+
+ // Check if this block contains a newly added PHI.
PHINode *PHI = dyn_cast<PHINode>(Info->AvailableVal);
if (!PHI || PHI->getNumIncomingValues() == Info->NumPreds)
continue;
More information about the llvm-commits
mailing list