[PATCH] D78310: [ProfileSummary] Add partial profile annotation on IR.

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 24 12:26:42 PDT 2020


wmi marked an inline comment as done.
wmi added inline comments.


================
Comment at: llvm/lib/IR/ProfileSummary.cpp:191
   SummaryEntryVector Summary;
-  if (!getSummaryFromMD(dyn_cast<MDTuple>(Tuple->getOperand(7)), Summary))
+  if (!getSummaryFromMD(dyn_cast<MDTuple>(Tuple->getOperand(i++)), Summary))
     return nullptr;
----------------
yamauchi wrote:
> wmi wrote:
> > yamauchi wrote:
> > > Depending on whether/how we do tuple->getNumOperands check above, we may need to check if there's a 9th operand here.
> > > 
> > I did the check above.
> Would we access out of bounds if we get an 8-entry tuple with the IsPartialProfile entry but without the DetailedSummary entry?
Another good catch. Thanks. Fixed.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D78310





More information about the llvm-commits mailing list