[all-commits] [llvm/llvm-project] d5afdb: [DFAPacketizer] Fix large compile-time regression ...

llvm-git-migration via All-commits all-commits at lists.llvm.org
Fri Oct 18 07:47:23 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d5afdbe5a456c055df19421c8d1810d65fbfaeee
      https://github.com/llvm/llvm-project/commit/d5afdbe5a456c055df19421c8d1810d65fbfaeee
  Author: James Molloy <jmolloy at google.com>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M llvm/include/llvm/Support/Automaton.h
    M llvm/utils/TableGen/DFAPacketizerEmitter.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list