[PATCH] D92674: [TableGen] Cache two things to improve speed.

Paul C. Anagnostopoulos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 4 11:19:59 PST 2020


Paul-C-Anagnostopoulos created this revision.
Paul-C-Anagnostopoulos added reviewers: lattner, nhaehnle, dblaikie, madhur13490.
Herald added a subscriber: hiraditya.
Paul-C-Anagnostopoulos requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This revision caches two things in order to speed up backends.

1. In RecordKeeper: The vectors of records returned by getAllDerivedDefinitions(). Many backends request the same record vectors multiple times. This includes big ones like the records inheriting from the Instruction class.

2. In CodeGenTarget: The instruction namespace. Again, many backends request it multiple times.

My timings indicate that this speeds up most backends by about 2%, for not much effort.

A couple of backends are full of extra phase timers. I will get rid of those before pushing this revision.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92674

Files:
  llvm/include/llvm/TableGen/Record.h
  llvm/lib/TableGen/Record.cpp
  llvm/utils/TableGen/CodeGenDAGPatterns.cpp
  llvm/utils/TableGen/CodeGenMapTable.cpp
  llvm/utils/TableGen/CodeGenTarget.cpp
  llvm/utils/TableGen/CodeGenTarget.h
  llvm/utils/TableGen/InstrInfoEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92674.309588.patch
Type: text/x-patch
Size: 9444 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201204/384295cd/attachment.bin>


More information about the llvm-commits mailing list