[PATCH] D142216: [MC] Store number of implicit operands in MCInstrDesc. NFC.

Sergei Barannikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 08:04:18 PST 2023


barannikov88 added inline comments.


================
Comment at: llvm/utils/TableGen/InstrInfoEmitter.cpp:911-912
     Record *Inst = II->TheDef;
-    std::vector<Record*> Uses = Inst->getValueAsListOfDefs("Uses");
+    std::vector<Record *> Uses = Inst->getValueAsListOfDefs("Uses");
+    std::vector<Record *> Defs = Inst->getValueAsListOfDefs("Defs");
+    llvm::append_range(Uses, Defs);
----------------
foad wrote:
> arsenm wrote:
> > Does this really need to generate a copy of vector for every instruction/
> Did you have an alternative in mind? Change `getValueAsListOfDefs` to append to an existing vector?
> 
> Or the `EmittedLists` map key could be a pair of vectors instead of a vector - but I have no idea what that would do to the overall efficiency of this code.
> 
> Would it help to //move// from Defs instead of //copy// from it?
`ArrayRef Uses = II->ImplicitUses;` should work.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142216/new/

https://reviews.llvm.org/D142216



More information about the llvm-commits mailing list