mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-23 02:32:11 +00:00
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
This commit is contained in:
parent
dfdddd8ed6
commit
b5b90eddcd
@ -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]]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user