[PATCH] D93654: [TableGen] Change getAllDerivedDefinitions() to return const vector &

Paul C. Anagnostopoulos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 11:17:01 PST 2020


Paul-C-Anagnostopoulos created this revision.
Paul-C-Anagnostopoulos added reviewers: lattner, nhaehnle, madhur13490, dblaikie, craig.topper.
Herald added subscribers: teijeong, rdzhabarov, tatianashp, jdoerfert, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini, hiraditya.
Paul-C-Anagnostopoulos requested review of this revision.
Herald added subscribers: llvm-commits, stephenneuendorffer, nicolasvasilache.
Herald added projects: MLIR, LLVM.

This will become the first of a series of patches to change getAllDerivedDefinitions() to return a const std::vector reference, rather than a copy of the vector. Now that the vectors are cached, the goal is to reduce the amount of copying.

I have updated four LLVM TableGen backends to accept the const reference, along with one MLIR backend that had to be changed.

I would appreciate any and all comments about this patch with respect to too much, too little, or just the right amount of copying.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93654

Files:
  llvm/include/llvm/TableGen/Record.h
  llvm/lib/TableGen/Record.cpp
  llvm/utils/TableGen/AsmMatcherEmitter.cpp
  llvm/utils/TableGen/Attributes.cpp
  llvm/utils/TableGen/CallingConvEmitter.cpp
  llvm/utils/TableGen/CodeEmitterGen.cpp
  mlir/tools/mlir-tblgen/OpInterfacesGen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93654.313155.patch
Type: text/x-patch
Size: 6276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201221/ba726e30/attachment.bin>


More information about the llvm-commits mailing list