mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-01 01:30:36 +00:00
Reserve space in vectors before topologically sorting into them. This improves the time to optimize 403.gcc from 28s to 23.5s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37699 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
82575d8ab1
commit
e8138ffeaf
@ -585,6 +585,7 @@ bool GVNPRE::dependsOnInvoke(Value* V) {
|
||||
/// above)
|
||||
void GVNPRE::clean(SmallPtrSet<Value*, 32>& set) {
|
||||
std::vector<Value*> worklist;
|
||||
worklist.reserve(set.size());
|
||||
topo_sort(set, worklist);
|
||||
|
||||
for (unsigned i = 0; i < worklist.size(); ++i) {
|
||||
@ -1173,6 +1174,7 @@ bool GVNPRE::insertion(Function& F) {
|
||||
// If there is more than one predecessor...
|
||||
if (pred_begin(BB) != pred_end(BB) && ++pred_begin(BB) != pred_end(BB)) {
|
||||
std::vector<Value*> workList;
|
||||
workList.reserve(anticIn.size());
|
||||
topo_sort(anticIn, workList);
|
||||
|
||||
DOUT << "Merge Block: " << BB->getName() << "\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user