HomePhabricator

[DFAPacketizer] Fix large compile-time regression for VLIW targets

Authored by jmolloy on Oct 18 2019, 7:48 AM.

Description

[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

Details

Committed
jmolloyOct 18 2019, 7:48 AM
Parents
rGe44524736c4a: Add ExceptionStream to llvm::Object::minidump
Branches
Unknown
Tags
Unknown