diff options
author | Aditya Nandakumar <aditya_nandakumar@apple.com> | 2019-02-15 01:37:54 +0000 |
---|---|---|
committer | Aditya Nandakumar <aditya_nandakumar@apple.com> | 2019-02-15 01:37:54 +0000 |
commit | 0e362ec19a7e20f4ea53f960ee578e0d5fa1b2e5 (patch) | |
tree | 57d478d5051f337756cc85321dccbdaf9d44c284 /llvm/lib/CodeGen/GlobalISel/Legalizer.cpp | |
parent | 77cbc62544cd0d3d0d6388bd23b5152f098743ca (diff) | |
download | bcm5719-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/Legalizer.cpp')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/Legalizer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp b/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp index 02fa4d12038..bd486d7dd1f 100644 --- a/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp +++ b/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp @@ -155,11 +155,13 @@ bool Legalizer::runOnMachineFunction(MachineFunction &MF) { if (!isPreISelGenericOpcode(MI.getOpcode())) continue; if (isArtifact(MI)) - ArtifactList.insert(&MI); + ArtifactList.deferred_insert(&MI); else - InstList.insert(&MI); + InstList.deferred_insert(&MI); } } + ArtifactList.finalize(); + InstList.finalize(); std::unique_ptr<MachineIRBuilder> MIRBuilder; GISelCSEInfo *CSEInfo = nullptr; bool EnableCSE = EnableCSEInLegalizer.getNumOccurrences() |