diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-08-04 21:06:15 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-08-04 21:06:15 +0000 | 
| commit | 4e1b4140ebcd9c4f3a4d4b6f87a60022d004c507 (patch) | |
| tree | db32f8408579da6747b16d24ca1871c2a7243af2 /llvm/lib/Transforms | |
| parent | b6a4ba808b4d965fc300071da69ea8e40aa78112 (diff) | |
| download | bcm5719-llvm-4e1b4140ebcd9c4f3a4d4b6f87a60022d004c507.tar.gz bcm5719-llvm-4e1b4140ebcd9c4f3a4d4b6f87a60022d004c507.zip | |
Use getNumPreds(BB) instead of computing them manually. This is a very small but
measurable speedup.
llvm-svn: 40823
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index cdccde39725..818c4171d60 100644 --- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/llvm/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 | 

