diff options
| author | Bob Wilson <bob.wilson@apple.com> | 2010-04-21 18:39:03 +0000 |
|---|---|---|
| committer | Bob Wilson <bob.wilson@apple.com> | 2010-04-21 18:39:03 +0000 |
| commit | a5e3cf9421016ff045b03c22f2381f524ac49339 (patch) | |
| tree | 3d4cc2d786be84349a6d6997cec28a7d134e9b3c | |
| parent | 044ac58243f2978911cc7f6e910e524db161ca93 (diff) | |
| download | external_llvm-a5e3cf9421016ff045b03c22f2381f524ac49339.zip external_llvm-a5e3cf9421016ff045b03c22f2381f524ac49339.tar.gz external_llvm-a5e3cf9421016ff045b03c22f2381f524ac49339.tar.bz2 | |
Fix a performance problem with the new SSAUpdater. This showed up in the
GCCAS time for MultiSource/Benchmarks/ASCI_Purple/SMG2000.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102009 91177308-0d34-0410-b5e6-96231b3b80d8
| -rw-r--r-- | lib/Transforms/Utils/SSAUpdater.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/SSAUpdater.cpp b/lib/Transforms/Utils/SSAUpdater.cpp index d491cbb..25d50db 100644 --- a/lib/Transforms/Utils/SSAUpdater.cpp +++ b/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; |
