summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-04-17 22:13:00 +0000
committerCraig Topper <craig.topper@gmail.com>2017-04-17 22:13:00 +0000
commitc228068d909273b6ddca3f5bbd8bf26f7550d5f7 (patch)
tree53a2a692a1d54ac1e96c54d3d5660f37c2aa76c6 /llvm/lib/Transforms/Utils
parentfb289ecde06ab88e82701c8a386f960572d1a7bb (diff)
downloadbcm5719-llvm-c228068d909273b6ddca3f5bbd8bf26f7550d5f7.tar.gz
bcm5719-llvm-c228068d909273b6ddca3f5bbd8bf26f7550d5f7.zip
[SimplifyCFG] Use hasNUses instead of comparing getNumUses to a constant."
The use list is a linked list so getNumUses requires a linear scan through the whole list. hasNUses will stop scanning at N and see if that is the end. llvm-svn: 300505
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 127a44df534..2f575b9d502 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -3086,7 +3086,7 @@ static bool mergeConditionalStores(BranchInst *PBI, BranchInst *QBI) {
if ((PTB && !HasOnePredAndOneSucc(PTB, PBI->getParent(), QBI->getParent())) ||
(QTB && !HasOnePredAndOneSucc(QTB, QBI->getParent(), PostBB)))
return false;
- if (PostBB->getNumUses() != 2 || QBI->getParent()->getNumUses() != 2)
+ if (!PostBB->hasNUses(2) || !QBI->getParent()->hasNUses(2))
return false;
// OK, this is a sequence of two diamonds or triangles.
OpenPOWER on IntegriCloud