[PATCH] D148145: [LegacyPM] Reduce number of calls to getName
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 12 10:38:56 PDT 2023
MaskRay accepted this revision.
MaskRay added inline comments.
This revision is now accepted and ready to land.
================
Comment at: llvm/lib/IR/LegacyPassManager.cpp:1412
+ // Store name outside of loop to avoid redundant calls.
+ StringRef Name = F.getName();
+ llvm::TimeTraceScope FunctionScope("OptFunction", Name);
----------------
Since the users are far away, consider `const StringRef Name = ...`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148145/new/
https://reviews.llvm.org/D148145
More information about the llvm-commits
mailing list