[PATCH] D66324: clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 17:34:30 PDT 2019


nickdesaulniers added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/MisExpect.cpp:108
+      // extract values from misexpect metadata
+      const ConstantInt *IndexCint =
+          mdconst::dyn_extract<ConstantInt>(MisExpectData->getOperand(1));
----------------
`const auto *IndexCInt`

`auto` should be used when the type is used in the rhs of an assignment such as in a template specifier IMO.  Ditto for below.


================
Comment at: llvm/lib/Transforms/Utils/MisExpect.cpp:123
+      const uint64_t CaseTotal = std::accumulate(
+          Weights.begin(), Weights.end(), (uint64_t)0, std::plus<uint64_t>());
+      const int NumUnlikelyTargets = Weights.size() - 1;
----------------
s/(uint64_t)0/0ULL/ might be simpler, but I don't know if `long long == uint64_t` on every host Clang can be built for...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66324





More information about the cfe-commits mailing list