summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
diff options
context:
space:
mode:
authorAditya Nandakumar <aditya_nandakumar@apple.com>2019-02-15 01:37:54 +0000
committerAditya Nandakumar <aditya_nandakumar@apple.com>2019-02-15 01:37:54 +0000
commit0e362ec19a7e20f4ea53f960ee578e0d5fa1b2e5 (patch)
tree57d478d5051f337756cc85321dccbdaf9d44c284 /llvm/lib/CodeGen/GlobalISel/Combiner.cpp
parent77cbc62544cd0d3d0d6388bd23b5152f098743ca (diff)
downloadbcm5719-llvm-0e362ec19a7e20f4ea53f960ee578e0d5fa1b2e5.tar.gz
bcm5719-llvm-0e362ec19a7e20f4ea53f960ee578e0d5fa1b2e5.zip
[GISel][NFC]: Add methods to speed up insertion into GISelWorklist
https://reviews.llvm.org/D58073 Speed up insertion during the initial populating phase into the GISelWorkList by deferring repeatedly resizing the DenseMap. This results in ~10% improvement in the combiner passes, and ~3% speedup in the Legalizer. reviewed by: aemerson. llvm-svn: 354093
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/Combiner.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/Combiner.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/Combiner.cpp b/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
index 093702bd45d..31cb1dbbc9b 100644
--- a/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
@@ -129,9 +129,10 @@ bool Combiner::combineMachineInstrs(MachineFunction &MF,
CurMI->eraseFromParentAndMarkDBGValuesForRemoval();
continue;
}
- WorkList.insert(CurMI);
+ WorkList.deferred_insert(CurMI);
}
}
+ WorkList.finalize();
// Main Loop. Process the instructions here.
while (!WorkList.empty()) {
MachineInstr *CurrInst = WorkList.pop_back_val();
OpenPOWER on IntegriCloud