diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-02-11 18:06:56 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-02-11 18:06:56 +0000 |
commit | b5b90eddcd5e0a3199a7d5064b9d7551cc1dff9c (patch) | |
tree | 6dda0a636df7d07f50d0b82393de7b90f54febe0 /lib | |
parent | dfdddd8ed621a44ec3da0e2fff42abf9e60e812a (diff) | |
download | external_llvm-b5b90eddcd5e0a3199a7d5064b9d7551cc1dff9c.zip external_llvm-b5b90eddcd5e0a3199a7d5064b9d7551cc1dff9c.tar.gz external_llvm-b5b90eddcd5e0a3199a7d5064b9d7551cc1dff9c.tar.bz2 |
Use array_pod_sort instead of std::sort for improved code size.
Use SmallVector instead of std::vector for better speed when indirectbr has
few successors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95879 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 477c1c7..6f60c7b 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -2063,11 +2063,11 @@ void SelectionDAGBuilder::visitSwitch(SwitchInst &SI) { void SelectionDAGBuilder::visitIndirectBr(IndirectBrInst &I) { // Update machine-CFG edges with unique successors. - std::vector<BasicBlock*> succs; + SmallVector<BasicBlock*, 32> succs; succs.reserve(I.getNumSuccessors()); for (unsigned i = 0, e = I.getNumSuccessors(); i != e; ++i) succs.push_back(I.getSuccessor(i)); - std::sort(succs.begin(), succs.end()); + array_pod_sort(succs.begin(), succs.end()); succs.erase(std::unique(succs.begin(), succs.end()), succs.end()); for (unsigned i = 0, e = succs.size(); i != e; ++i) CurMBB->addSuccessor(FuncInfo.MBBMap[succs[i]]); |