aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-04 21:06:15 +0000
committerChris Lattner <sabre@nondot.org>2007-08-04 21:06:15 +0000
commit127ed3c9299d8315723ffd470b598867fb49c972 (patch)
treed3747b9d536f8a75fdea77c0d3e2aae20cab3bc3 /lib/Transforms/Utils/PromoteMemoryToRegister.cpp
parent1e76af30116f4554fcf02c0f95705af1504b9645 (diff)
downloadexternal_llvm-127ed3c9299d8315723ffd470b598867fb49c972.zip
external_llvm-127ed3c9299d8315723ffd470b598867fb49c972.tar.gz
external_llvm-127ed3c9299d8315723ffd470b598867fb49c972.tar.bz2
Use getNumPreds(BB) instead of computing them manually. This is a very small but
measurable speedup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40823 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/PromoteMemoryToRegister.cpp')
-rw-r--r--lib/Transforms/Utils/PromoteMemoryToRegister.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
index cdccde3..818c417 100644
--- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
@@ -496,14 +496,14 @@ void PromoteMem2Reg::run() {
if (&BB->front() != SomePHI)
continue;
- // Count the number of preds for BB.
- SmallVector<BasicBlock*, 16> Preds(pred_begin(BB), pred_end(BB));
-
// Only do work here if there the PHI nodes are missing incoming values. We
// know that all PHI nodes that were inserted in a block will have the same
// number of incoming values, so we can just check any of them.
- if (SomePHI->getNumIncomingValues() == Preds.size())
+ if (SomePHI->getNumIncomingValues() == getNumPreds(BB))
continue;
+
+ // Get the preds for BB.
+ SmallVector<BasicBlock*, 16> Preds(pred_begin(BB), pred_end(BB));
// Ok, now we know that all of the PHI nodes are missing entries for some
// basic blocks. Start by sorting the incoming predecessors for efficient