summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
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
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')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/Combiner.cpp3
-rw-r--r--llvm/lib/CodeGen/GlobalISel/Legalizer.cpp6
2 files changed, 6 insertions, 3 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();
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