IR: Optimize size of use-list order shuffle vectors

Since we're storing lots of these, save two-pointers per vector with a
custom type rather than using the relatively heavy `SmallVector`.

Part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214135 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2014-07-28 22:41:50 +00:00
parent 807538b567
commit f575ec435e
2 changed files with 54 additions and 8 deletions

View File

@ -133,12 +133,11 @@ static void predictValueUseListOrderImpl(const Value *V, const Function *F,
return;
// Store the shuffle.
UseListOrder O;
O.V = V;
O.F = F;
for (auto &I : List)
O.Shuffle.push_back(I.second);
Stack.push_back(O);
UseListOrder O(V, F, List.size());
assert(List.size() == O.Shuffle.size() && "Wrong size");
for (size_t I = 0, E = List.size(); I != E; ++I)
O.Shuffle[I] = List[I].second;
Stack.emplace_back(std::move(O));
}
static void predictValueUseListOrder(const Value *V, const Function *F,