summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorJames Molloy <jmolloy@google.com>2019-10-18 14:48:35 +0000
committerJames Molloy <jmolloy@google.com>2019-10-18 14:48:35 +0000
commitd5afdbe5a456c055df19421c8d1810d65fbfaeee (patch)
treeb46b516f1b6282ac0e557761f50525ce1edd2b47 /llvm/utils
parente44524736c4a97ae4fb37193e58647f838f6d36a (diff)
downloadbcm5719-llvm-d5afdbe5a456c055df19421c8d1810d65fbfaeee.tar.gz
bcm5719-llvm-d5afdbe5a456c055df19421c8d1810d65fbfaeee.zip
[DFAPacketizer] Fix large compile-time regression for VLIW targets
D68992 / rL375086 refactored the packetizer and removed a bunch of logic. Unfortunately it creates an Automaton object whenever a DFAPacketizer is required. These objects have no longevity, and in particular on a debug build the population of the Automaton's transition map from the underlying table is very slow (because it is called ~10 times per MachineFunction, in the testcase I'm looking at). This patch changes Automaton to wrap its underlying constant data in std::shared_ptr, which allows trivial copy construction. The DFAPacketizer creation function now creates a static archetypical Automaton and copies that whenever a new DFAPacketizer is required. This takes a testcase down from ~20s to ~0.5s in debug mode. llvm-svn: 375240
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/DFAPacketizerEmitter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/DFAPacketizerEmitter.cpp b/llvm/utils/TableGen/DFAPacketizerEmitter.cpp
index 0d3c6fdc933..ccb4ef1b967 100644
--- a/llvm/utils/TableGen/DFAPacketizerEmitter.cpp
+++ b/llvm/utils/TableGen/DFAPacketizerEmitter.cpp
@@ -538,10 +538,10 @@ void DFAPacketizerEmitter::emitForItineraries(
OS << "DFAPacketizer *" << SubTargetClassName << "::"
<< "create" << DFAName
<< "DFAPacketizer(const InstrItineraryData *IID) const {\n"
- << " Automaton<uint64_t> A(ArrayRef<" << TargetAndDFAName
+ << " static Automaton<uint64_t> A(ArrayRef<" << TargetAndDFAName
<< "Transition>(" << TargetAndDFAName << "Transitions), "
<< TargetAndDFAName << "TransitionInfo);\n"
- << " return new DFAPacketizer(IID, std::move(A));\n"
+ << " return new DFAPacketizer(IID, A);\n"
<< "\n}\n\n";
}
OpenPOWER on IntegriCloud