[PATCH] D140963: Auto Causes copy problems

Wang, Xin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 03:28:23 PST 2023


XinWang10 added inline comments.


================
Comment at: llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp:100
       CurrentPosition = 0;
-      for (auto BBIndexStr : BBIndexes) {
+      for (auto &BBIndexStr : BBIndexes) {
         unsigned long long BBIndex;
----------------
XinWang10 wrote:
> pengfei wrote:
> > `StringRef` is a small class. It's common to use copy in LLVM code. I guess it may be better to use copy than reference in small size sturctures.
> I tried to make an assemble file, seems it is better to use copy here, little struct can be transfered by regs.
sorry, by stack not regs.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140963



More information about the llvm-commits mailing list