summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel/Legalizer.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/Legalizer.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/Legalizer.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/Legalizer.cpp6
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()
OpenPOWER on IntegriCloud