[PATCH] D113839: [NFC] Use Optional<ProfileCount> to model invalid counts

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 13 22:07:38 PST 2021


mtrofin created this revision.
mtrofin added reviewers: davidxl, eraman.
Herald added subscribers: ormris, dexonsmith, wenlei, haicheng, hiraditya.
mtrofin requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

ProfileCount could model invalid values, but a user had no indication
that the getCount method could return bogus data. Optional<ProfileCount>
addresses that, because the user must dereference the optional. In
addition, the patch removes concept duplication.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113839

Files:
  llvm/include/llvm/IR/Function.h
  llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp
  llvm/lib/Analysis/InlineCost.cpp
  llvm/lib/Analysis/ProfileSummaryInfo.cpp
  llvm/lib/CodeGen/MachineSizeOpts.cpp
  llvm/lib/IR/Function.cpp
  llvm/lib/Transforms/IPO/PartialInlining.cpp
  llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  llvm/lib/Transforms/Utils/InlineFunction.cpp
  llvm/unittests/IR/MetadataTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113839.387058.patch
Type: text/x-patch
Size: 13035 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211114/59b666db/attachment.bin>


More information about the llvm-commits mailing list