[PATCH] D48105: [llvm][Instrumentation] Add Call Graph Profile pass
Saleem Abdulrasool via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 12 20:32:02 PDT 2018
compnerd added inline comments.
================
Comment at: lib/Transforms/Instrumentation/CGProfile.cpp:48
+
+ for (auto &F : M) {
+ if (F.isDeclaration())
----------------
Can this not be `const auto &F : M`?
================
Comment at: lib/Transforms/Instrumentation/CGProfile.cpp:53
+ auto &BFI = getAnalysis<BlockFrequencyInfoWrapperPass>(F).getBFI();
+ for (auto &BB : F) {
+ Optional<uint64_t> BBCount = BFI.getBlockProfileCount(&BB);
----------------
Can this not be `const auto &BB : F`?
================
Comment at: lib/Transforms/Instrumentation/CGProfile.cpp:57
+ continue;
+ for (auto &I : BB) {
+ auto *CI = dyn_cast<CallInst>(&I);
----------------
Can this not be `const auto &I : BB`?
Repository:
rL LLVM
https://reviews.llvm.org/D48105
More information about the llvm-commits
mailing list