<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 29, 2017, at 10:06 AM, Xinliang David Li <<a href="mailto:davidxl@google.com" class="">davidxl@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Jun 29, 2017 at 10:03 AM, <span dir="ltr" class=""><<a href="mailto:vsk@apple.com" target="_blank" class="">vsk@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">I'm in favor of removing the counters from this struct, but keeping it as a member of InstrProfRecord [*]</div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Do you mean the error counters? I am fine with removing them. </div></div></div></div></div></blockquote><div><br class=""></div>Yes, getNum*Mismatches have all gone unused.</div><div><br class=""></div><div>vedant</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">David</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><br class=""></div><div class="">I expected to use the counters in this struct to aid debugging, and to eventually implement better error reporting. This hasn't panned out: the counters haven't been much help (at least, not to me, I'm curious as to whether @davidxl has made use of them). It's totally fair to remove them until we have a better plan.</div><div class=""><br class=""></div><div class="">Having a soft error tracker within InstrProfRecord makes error tracking very 'nice'. We can make sure an IPR isn't destroyed without its error state being considered. We can also handle copying/moving IPRs easily. @dblaikie The cost of a single instrprof_error field doesn't seem too high (at least, it'd be a lot better than what we have now). Would that work for you?</div><div class=""><br class=""></div><div class="">thanks,</div><div class="">vedant</div><div class=""><br class=""></div><div class="">[*] I'm also volunteering to make the change, if there's agreement it's the right way to go :).</div><div class=""><div class="h5"><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 29, 2017, at 9:44 AM, Xinliang David Li <<a href="mailto:davidxl@google.com" target="_blank" class="">davidxl@google.com</a>> wrote:</div><br class="m_-8470517226796145429Apple-interchange-newline"><div class=""><div dir="ltr" class="">The size impact of this struct is indeed pretty large. We can consider compress the size of it significantly. For instance, making each member uint8_t. If the number of errors of each category > 255, it can be capped at 255 and the error message handling can be adjusted properly.<div class=""><br class=""></div><div class="">David</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jun 28, 2017 at 11:57 PM, David Blaikie <span dir="ltr" class=""><<a href="mailto:dblaikie@gmail.com" target="_blank" class="">dblaikie@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">This seems to have gone unused for a year so far - shall we remove it until there's an actual use case?<br class=""><br class="">I came across this because the sizeof(InstrProfRecord) contributes significantly to the memory footprint of llvm-profdata merge (I've made one big improvement so far (14GB -> 10GB for an example large profile)). I have a change in mind/prototyped that helps that (10GB -> 5GB) by moving the counters into a sub-struct of InstrProfRecord and using only that sub-struct in the InstrProfWriter (since it has the name and hash in the maps its using for lookup during merging - so they don't need to be duplicated in the values too). But this SoftInstrProfErrors is used from the counter-related functions and is quite large, so naively it would have to move into this sub-struct & take up lots of space.<br class=""><br class="">So at the very least I'd like to revisit the choice to make this a member, and instead go with the earlier version of this patch that wired it through function parameters instead - but given the lack of use, I think maybe it'd be better to remove this unused abstraction & go back to the simpler error handling that was present before.<br class=""><br class="">- Dave<br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Wed, May 11, 2016 at 12:48 PM Vedant Kumar via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: vedantk<br class="">
Date: Wed May 11 14:42:19 2016<br class="">
New Revision: 269222<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=269222&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject?rev=269222&view=rev</a><br class="">
Log:<br class="">
[ProfileData] Use SoftInstrProfErrors to count soft errors, NFC<br class="">
<br class="">
Differential Revision: <a href="http://reviews.llvm.org/D20082" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/D20082</a><br class="">
<br class="">
Modified:<br class="">
llvm/trunk/include/llvm/Profil<wbr class="">eData/InstrProf.h<br class="">
llvm/trunk/lib/ProfileData/Ins<wbr class="">trProf.cpp<br class="">
llvm/trunk/lib/ProfileData/Ins<wbr class="">trProfWriter.cpp<br class="">
<br class="">
Modified: llvm/trunk/include/llvm/Profil<wbr class="">eData/InstrProf.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProf.h?rev=269222&r1=269221&r2=269222&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/llvm/trunk/include/llvm/<wbr class="">ProfileData/InstrProf.h?rev=<wbr class="">269222&r1=269221&r2=269222&<wbr class="">view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/include/llvm/Profil<wbr class="">eData/InstrProf.h (original)<br class="">
+++ llvm/trunk/include/llvm/Profil<wbr class="">eData/InstrProf.h Wed May 11 14:42:19 2016<br class="">
@@ -284,15 +284,51 @@ inline std::error_code make_error_code(i<br class="">
return std::error_code(static_cast<in<wbr class="">t>(E), instrprof_category());<br class="">
}<br class="">
<br class="">
-inline instrprof_error MergeResult(instrprof_error &Accumulator,<br class="">
- instrprof_error Result) {<br class="">
- // Prefer first error encountered as later errors may be secondary effects of<br class="">
- // the initial problem.<br class="">
- if (Accumulator == instrprof_error::success &&<br class="">
- Result != instrprof_error::success)<br class="">
- Accumulator = Result;<br class="">
- return Accumulator;<br class="">
-}<br class="">
+class SoftInstrProfErrors {<br class="">
+ /// Count the number of soft instrprof_errors encountered and keep track of<br class="">
+ /// the first such error for reporting purposes.<br class="">
+<br class="">
+ /// The first soft error encountered.<br class="">
+ instrprof_error FirstError;<br class="">
+<br class="">
+ /// The number of hash mismatches.<br class="">
+ unsigned NumHashMismatches;<br class="">
+<br class="">
+ /// The number of count mismatches.<br class="">
+ unsigned NumCountMismatches;<br class="">
+<br class="">
+ /// The number of counter overflows.<br class="">
+ unsigned NumCounterOverflows;<br class="">
+<br class="">
+ /// The number of value site count mismatches.<br class="">
+ unsigned NumValueSiteCountMismatches;<br class="">
+<br class="">
+public:<br class="">
+ SoftInstrProfErrors()<br class="">
+ : FirstError(instrprof_error::su<wbr class="">ccess), NumHashMismatches(0),<br class="">
+ NumCountMismatches(0), NumCounterOverflows(0),<br class="">
+ NumValueSiteCountMismatches(0) {}<br class="">
+<br class="">
+ /// Track a soft error (\p IE) and increment its associated counter.<br class="">
+ void addError(instrprof_error IE);<br class="">
+<br class="">
+ /// Get the number of hash mismatches.<br class="">
+ unsigned getNumHashMismatches() const { return NumHashMismatches; }<br class="">
+<br class="">
+ /// Get the number of count mismatches.<br class="">
+ unsigned getNumCountMismatches() const { return NumCountMismatches; }<br class="">
+<br class="">
+ /// Get the number of counter overflows.<br class="">
+ unsigned getNumCounterOverflows() const { return NumCounterOverflows; }<br class="">
+<br class="">
+ /// Get the number of value site count mismatches.<br class="">
+ unsigned getNumValueSiteCountMismatches<wbr class="">() const {<br class="">
+ return NumValueSiteCountMismatches;<br class="">
+ }<br class="">
+<br class="">
+ /// Return an error code for the first encountered error.<br class="">
+ std::error_code getError() const { return make_error_code(FirstError); }<br class="">
+};<br class="">
<br class="">
namespace object {<br class="">
class SectionRef;<br class="">
@@ -465,19 +501,21 @@ struct InstrProfValueSiteRecord {<br class="">
<br class="">
/// Merge data from another InstrProfValueSiteRecord<br class="">
/// Optionally scale merged counts by \p Weight.<br class="">
- instrprof_error merge(InstrProfValueSiteRecord &Input, uint64_t Weight = 1);<br class="">
+ void merge(SoftInstrProfErrors &SIPE, InstrProfValueSiteRecord &Input,<br class="">
+ uint64_t Weight = 1);<br class="">
/// Scale up value profile data counts.<br class="">
- instrprof_error scale(uint64_t Weight);<br class="">
+ void scale(SoftInstrProfErrors &SIPE, uint64_t Weight);<br class="">
};<br class="">
<br class="">
/// Profiling information for a single function.<br class="">
struct InstrProfRecord {<br class="">
- InstrProfRecord() {}<br class="">
+ InstrProfRecord() : SIPE() {}<br class="">
InstrProfRecord(StringRef Name, uint64_t Hash, std::vector<uint64_t> Counts)<br class="">
- : Name(Name), Hash(Hash), Counts(std::move(Counts)) {}<br class="">
+ : Name(Name), Hash(Hash), Counts(std::move(Counts)), SIPE() {}<br class="">
StringRef Name;<br class="">
uint64_t Hash;<br class="">
std::vector<uint64_t> Counts;<br class="">
+ SoftInstrProfErrors SIPE;<br class="">
<br class="">
typedef std::vector<std::pair<uint64_t<wbr class="">, uint64_t>> ValueMapType;<br class="">
<br class="">
@@ -512,11 +550,11 @@ struct InstrProfRecord {<br class="">
<br class="">
/// Merge the counts in \p Other into this one.<br class="">
/// Optionally scale merged counts by \p Weight.<br class="">
- instrprof_error merge(InstrProfRecord &Other, uint64_t Weight = 1);<br class="">
+ void merge(InstrProfRecord &Other, uint64_t Weight = 1);<br class="">
<br class="">
/// Scale up profile counts (including value profile data) by<br class="">
/// \p Weight.<br class="">
- instrprof_error scale(uint64_t Weight);<br class="">
+ void scale(uint64_t Weight);<br class="">
<br class="">
/// Sort value profile data (per site) by count.<br class="">
void sortValueData() {<br class="">
@@ -533,6 +571,9 @@ struct InstrProfRecord {<br class="">
getValueSitesForKind(Kind).cl<wbr class="">ear();<br class="">
}<br class="">
<br class="">
+ /// Get the error contained within the record's soft error counter.<br class="">
+ std::error_code getError() const { return SIPE.getError(); }<br class="">
+<br class="">
private:<br class="">
std::vector<InstrProfValueSit<wbr class="">eRecord> IndirectCallSites;<br class="">
const std::vector<InstrProfValueSite<wbr class="">Record> &<br class="">
@@ -559,10 +600,10 @@ private:<br class="">
<br class="">
// Merge Value Profile data from Src record to this record for ValueKind.<br class="">
// Scale merged value counts by \p Weight.<br class="">
- instrprof_error mergeValueProfData(uint32_t ValueKind, InstrProfRecord &Src,<br class="">
- uint64_t Weight);<br class="">
+ void mergeValueProfData(uint32_t ValueKind, InstrProfRecord &Src,<br class="">
+ uint64_t Weight);<br class="">
// Scale up value profile data count.<br class="">
- instrprof_error scaleValueProfData(uint32_t ValueKind, uint64_t Weight);<br class="">
+ void scaleValueProfData(uint32_t ValueKind, uint64_t Weight);<br class="">
};<br class="">
<br class="">
uint32_t InstrProfRecord::getNumValueKi<wbr class="">nds() const {<br class="">
<br class="">
Modified: llvm/trunk/lib/ProfileData/Ins<wbr class="">trProf.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProf.cpp?rev=269222&r1=269221&r2=269222&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/llvm/trunk/lib/ProfileDa<wbr class="">ta/InstrProf.cpp?rev=269222&<wbr class="">r1=269221&r2=269222&view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/lib/ProfileData/Ins<wbr class="">trProf.cpp (original)<br class="">
+++ llvm/trunk/lib/ProfileData/Ins<wbr class="">trProf.cpp Wed May 11 14:42:19 2016<br class="">
@@ -80,6 +80,31 @@ const std::error_category &llvm::instrpr<br class="">
<br class="">
namespace llvm {<br class="">
<br class="">
+void SoftInstrProfErrors::addError(<wbr class="">instrprof_error IE) {<br class="">
+ if (IE == instrprof_error::success)<br class="">
+ return;<br class="">
+<br class="">
+ if (FirstError == instrprof_error::success)<br class="">
+ FirstError = IE;<br class="">
+<br class="">
+ switch (IE) {<br class="">
+ case instrprof_error::hash_mismatch<wbr class="">:<br class="">
+ ++NumHashMismatches;<br class="">
+ break;<br class="">
+ case instrprof_error::count_mismatc<wbr class="">h:<br class="">
+ ++NumCountMismatches;<br class="">
+ break;<br class="">
+ case instrprof_error::counter_overf<wbr class="">low:<br class="">
+ ++NumCounterOverflows;<br class="">
+ break;<br class="">
+ case instrprof_error::value_site_co<wbr class="">unt_mismatch:<br class="">
+ ++NumValueSiteCountMismatches;<br class="">
+ break;<br class="">
+ default:<br class="">
+ llvm_unreachable("Not a soft error");<br class="">
+ }<br class="">
+}<br class="">
+<br class="">
std::string getPGOFuncName(StringRef RawFuncName,<br class="">
GlobalValue::LinkageTypes Linkage,<br class="">
StringRef FileName,<br class="">
@@ -291,13 +316,13 @@ std::error_code readPGOFuncNameStrings(S<br class="">
return make_error_code(instrprof_erro<wbr class="">r::success);<br class="">
}<br class="">
<br class="">
-instrprof_error InstrProfValueSiteRecord::merg<wbr class="">e(InstrProfValueSiteRecord &Input,<br class="">
- uint64_t Weight) {<br class="">
+void InstrProfValueSiteRecord::merg<wbr class="">e(SoftInstrProfErrors &SIPE,<br class="">
+ InstrProfValueSiteRecord &Input,<br class="">
+ uint64_t Weight) {<br class="">
this->sortByTargetValues();<br class="">
Input.sortByTargetValues();<br class="">
auto I = ValueData.begin();<br class="">
auto IE = ValueData.end();<br class="">
- instrprof_error Result = instrprof_error::success;<br class="">
for (auto J = Input.ValueData.begin(), JE = Input.ValueData.end(); J != JE;<br class="">
++J) {<br class="">
while (I != IE && I->Value < J->Value)<br class="">
@@ -306,92 +331,80 @@ instrprof_error InstrProfValueSiteRecord<br class="">
bool Overflowed;<br class="">
I->Count = SaturatingMultiplyAdd(J->Count<wbr class="">, Weight, I->Count, &Overflowed);<br class="">
if (Overflowed)<br class="">
- Result = instrprof_error::counter_overf<wbr class="">low;<br class="">
+ SIPE.addError(instrprof_error:<wbr class="">:counter_overflow);<br class="">
++I;<br class="">
continue;<br class="">
}<br class="">
ValueData.insert(I, *J);<br class="">
}<br class="">
- return Result;<br class="">
}<br class="">
<br class="">
-instrprof_error InstrProfValueSiteRecord::scal<wbr class="">e(uint64_t Weight) {<br class="">
- instrprof_error Result = instrprof_error::success;<br class="">
+void InstrProfValueSiteRecord::scal<wbr class="">e(SoftInstrProfErrors &SIPE,<br class="">
+ uint64_t Weight) {<br class="">
for (auto I = ValueData.begin(), IE = ValueData.end(); I != IE; ++I) {<br class="">
bool Overflowed;<br class="">
I->Count = SaturatingMultiply(I->Count, Weight, &Overflowed);<br class="">
if (Overflowed)<br class="">
- Result = instrprof_error::counter_overf<wbr class="">low;<br class="">
+ SIPE.addError(instrprof_error:<wbr class="">:counter_overflow);<br class="">
}<br class="">
- return Result;<br class="">
}<br class="">
<br class="">
// Merge Value Profile data from Src record to this record for ValueKind.<br class="">
// Scale merged value counts by \p Weight.<br class="">
-instrprof_error InstrProfRecord::mergeValuePro<wbr class="">fData(uint32_t ValueKind,<br class="">
- InstrProfRecord &Src,<br class="">
- uint64_t Weight) {<br class="">
+void InstrProfRecord::mergeValuePro<wbr class="">fData(uint32_t ValueKind,<br class="">
+ InstrProfRecord &Src,<br class="">
+ uint64_t Weight) {<br class="">
uint32_t ThisNumValueSites = getNumValueSites(ValueKind);<br class="">
uint32_t OtherNumValueSites = Src.getNumValueSites(ValueKind<wbr class="">);<br class="">
- if (ThisNumValueSites != OtherNumValueSites)<br class="">
- return instrprof_error::value_site_co<wbr class="">unt_mismatch;<br class="">
+ if (ThisNumValueSites != OtherNumValueSites) {<br class="">
+ SIPE.addError(instrprof_error:<wbr class="">:value_site_count_mismatch);<br class="">
+ return;<br class="">
+ }<br class="">
std::vector<InstrProfValueSit<wbr class="">eRecord> &ThisSiteRecords =<br class="">
getValueSitesForKind(ValueKin<wbr class="">d);<br class="">
std::vector<InstrProfValueSit<wbr class="">eRecord> &OtherSiteRecords =<br class="">
Src.getValueSitesForKind(Valu<wbr class="">eKind);<br class="">
- instrprof_error Result = instrprof_error::success;<br class="">
for (uint32_t I = 0; I < ThisNumValueSites; I++)<br class="">
- MergeResult(Result, ThisSiteRecords[I].merge(Other<wbr class="">SiteRecords[I], Weight));<br class="">
- return Result;<br class="">
+ ThisSiteRecords[I].merge(SIPE, OtherSiteRecords[I], Weight);<br class="">
}<br class="">
<br class="">
-instrprof_error InstrProfRecord::merge(InstrPr<wbr class="">ofRecord &Other,<br class="">
- uint64_t Weight) {<br class="">
+void InstrProfRecord::merge(InstrPr<wbr class="">ofRecord &Other, uint64_t Weight) {<br class="">
// If the number of counters doesn't match we either have bad data<br class="">
// or a hash collision.<br class="">
- if (Counts.size() != Other.Counts.size())<br class="">
- return instrprof_error::count_mismatc<wbr class="">h;<br class="">
-<br class="">
- instrprof_error Result = instrprof_error::success;<br class="">
+ if (Counts.size() != Other.Counts.size()) {<br class="">
+ SIPE.addError(instrprof_error:<wbr class="">:count_mismatch);<br class="">
+ return;<br class="">
+ }<br class="">
<br class="">
for (size_t I = 0, E = Other.Counts.size(); I < E; ++I) {<br class="">
bool Overflowed;<br class="">
Counts[I] =<br class="">
SaturatingMultiplyAdd(Other.C<wbr class="">ounts[I], Weight, Counts[I], &Overflowed);<br class="">
if (Overflowed)<br class="">
- Result = instrprof_error::counter_overf<wbr class="">low;<br class="">
+ SIPE.addError(instrprof_error:<wbr class="">:counter_overflow);<br class="">
}<br class="">
<br class="">
for (uint32_t Kind = IPVK_First; Kind <= IPVK_Last; ++Kind)<br class="">
- MergeResult(Result, mergeValueProfData(Kind, Other, Weight));<br class="">
-<br class="">
- return Result;<br class="">
+ mergeValueProfData(Kind, Other, Weight);<br class="">
}<br class="">
<br class="">
-instrprof_error InstrProfRecord::scaleValuePro<wbr class="">fData(uint32_t ValueKind,<br class="">
- uint64_t Weight) {<br class="">
+void InstrProfRecord::scaleValuePro<wbr class="">fData(uint32_t ValueKind, uint64_t Weight) {<br class="">
uint32_t ThisNumValueSites = getNumValueSites(ValueKind);<br class="">
std::vector<InstrProfValueSit<wbr class="">eRecord> &ThisSiteRecords =<br class="">
getValueSitesForKind(ValueKin<wbr class="">d);<br class="">
- instrprof_error Result = instrprof_error::success;<br class="">
for (uint32_t I = 0; I < ThisNumValueSites; I++)<br class="">
- MergeResult(Result, ThisSiteRecords[I].scale(Weigh<wbr class="">t));<br class="">
- return Result;<br class="">
+ ThisSiteRecords[I].scale(SIPE, Weight);<br class="">
}<br class="">
<br class="">
-instrprof_error InstrProfRecord::scale(uint64_<wbr class="">t Weight) {<br class="">
- instrprof_error Result = instrprof_error::success;<br class="">
+void InstrProfRecord::scale(uint64_<wbr class="">t Weight) {<br class="">
for (auto &Count : this->Counts) {<br class="">
bool Overflowed;<br class="">
Count = SaturatingMultiply(Count, Weight, &Overflowed);<br class="">
- if (Overflowed && Result == instrprof_error::success) {<br class="">
- Result = instrprof_error::counter_overf<wbr class="">low;<br class="">
- }<br class="">
+ if (Overflowed)<br class="">
+ SIPE.addError(instrprof_error:<wbr class="">:counter_overflow);<br class="">
}<br class="">
for (uint32_t Kind = IPVK_First; Kind <= IPVK_Last; ++Kind)<br class="">
- MergeResult(Result, scaleValueProfData(Kind, Weight));<br class="">
-<br class="">
- return Result;<br class="">
+ scaleValueProfData(Kind, Weight);<br class="">
}<br class="">
<br class="">
// Map indirect call target name hash to name string.<br class="">
<br class="">
Modified: llvm/trunk/lib/ProfileData/Ins<wbr class="">trProfWriter.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProfWriter.cpp?rev=269222&r1=269221&r2=269222&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/llvm/trunk/lib/ProfileDa<wbr class="">ta/InstrProfWriter.cpp?rev=<wbr class="">269222&r1=269221&r2=269222&<wbr class="">view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/lib/ProfileData/Ins<wbr class="">trProfWriter.cpp (original)<br class="">
+++ llvm/trunk/lib/ProfileData/Ins<wbr class="">trProfWriter.cpp Wed May 11 14:42:19 2016<br class="">
@@ -166,22 +166,21 @@ std::error_code InstrProfWriter::addReco<br class="">
ProfileDataMap.insert(std::ma<wbr class="">ke_pair(I.Hash, InstrProfRecord()));<br class="">
InstrProfRecord &Dest = Where->second;<br class="">
<br class="">
- instrprof_error Result = instrprof_error::success;<br class="">
if (NewFunc) {<br class="">
// We've never seen a function with this name and hash, add it.<br class="">
Dest = std::move(I);<br class="">
// Fix up the name to avoid dangling reference.<br class="">
Dest.Name = FunctionData.find(Dest.Name)-><wbr class="">getKey();<br class="">
if (Weight > 1)<br class="">
- Result = Dest.scale(Weight);<br class="">
+ Dest.scale(Weight);<br class="">
} else {<br class="">
// We're updating a function we've seen before.<br class="">
- Result = Dest.merge(I, Weight);<br class="">
+ Dest.merge(I, Weight);<br class="">
}<br class="">
<br class="">
Dest.sortValueData();<br class="">
<br class="">
- return Result;<br class="">
+ return Dest.getError();<br class="">
}<br class="">
<br class="">
bool InstrProfWriter::shouldEncodeD<wbr class="">ata(const ProfilingData &PD) {<br class="">
<br class="">
<br class="">
______________________________<wbr class="">_________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div></div>
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>