HomePhabricator

[X86][TableGen] Recommitting the X86 memory folding tables TableGen backend…

Authored by aymanmus on Oct 8 2017, 2:20 AM.

Description

[X86][TableGen] Recommitting the X86 memory folding tables TableGen backend while disabling it by default.

After the original commit (rL304088) was reverted, a discussion in llvm-dev was opened on 'how to accomplish this task'.
In the discussion we concluded that the best way to achieve our goal (which is to automate the folding tables and remove the manually maintained tables) is:

  1. Commit the tablegen backend disabled by default.
  2. Proceed with an incremental updating of the manual tables - while checking the validity of each added entry.
  3. Repeat previous step until we reach a state where the generated and the manual tables are identical. Then we can safely remove the manual tables and include the generated tables instead.
  4. Schedule periodical (1 week/2 weeks/1 month) runs of the pass:
    • if changes appear (new entries):
      • make sure the entries are legal
      • If they are not, mark them as illegal to folding
    • Commit the changes (if there are any).

CMake flag added for this purpose is "X86_GEN_FOLD_TABLES". Building with this flags will run the pass and emit the X86GenFoldTables.inc file under build/lib/Target/X86/ directory which is a good reference for any developer who wants to take part in the effort of completing the current folding tables.

Differential Revision: https://reviews.llvm.org/D38028

llvm-svn: 315173