summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-04-21 18:39:03 +0000
committerBob Wilson <bob.wilson@apple.com>2010-04-21 18:39:03 +0000
commit4c7f50afb8f23509d38f98012326a1a367f77284 (patch)
tree612626678498b7bb7eac41341457c9bfe90c734e /llvm/lib/Transforms/Utils
parentd85afee1340d279b88abbca19756b37d7ce3f79b (diff)
downloadbcm5719-llvm-4c7f50afb8f23509d38f98012326a1a367f77284.tar.gz
bcm5719-llvm-4c7f50afb8f23509d38f98012326a1a367f77284.zip
Fix a performance problem with the new SSAUpdater. This showed up in the
GCCAS time for MultiSource/Benchmarks/ASCI_Purple/SMG2000. llvm-svn: 102009
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/SSAUpdater.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SSAUpdater.cpp b/llvm/lib/Transforms/Utils/SSAUpdater.cpp
index d491cbb9155..25d50dbf2a8 100644
--- a/llvm/lib/Transforms/Utils/SSAUpdater.cpp
+++ b/llvm/lib/Transforms/Utils/SSAUpdater.cpp
@@ -529,9 +529,15 @@ void SSAUpdater::FindAvailableVals(BlockListTy *BlockList) {
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;
OpenPOWER on IntegriCloud