Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
#include "llvm/IR/Value.h" | #include "llvm/IR/Value.h" | ||||
#include "llvm/IR/ValueSymbolTable.h" | #include "llvm/IR/ValueSymbolTable.h" | ||||
#include "llvm/MC/StringTableBuilder.h" | #include "llvm/MC/StringTableBuilder.h" | ||||
#include "llvm/MC/TargetRegistry.h" | #include "llvm/MC/TargetRegistry.h" | ||||
#include "llvm/Object/IRSymtab.h" | #include "llvm/Object/IRSymtab.h" | ||||
#include "llvm/Support/AtomicOrdering.h" | #include "llvm/Support/AtomicOrdering.h" | ||||
#include "llvm/Support/Casting.h" | #include "llvm/Support/Casting.h" | ||||
#include "llvm/Support/CommandLine.h" | #include "llvm/Support/CommandLine.h" | ||||
#include "llvm/Support/Debug.h" | |||||
#include "llvm/Support/Endian.h" | #include "llvm/Support/Endian.h" | ||||
#include "llvm/Support/Error.h" | #include "llvm/Support/Error.h" | ||||
#include "llvm/Support/ErrorHandling.h" | #include "llvm/Support/ErrorHandling.h" | ||||
#include "llvm/Support/MathExtras.h" | #include "llvm/Support/MathExtras.h" | ||||
#include "llvm/Support/SHA1.h" | #include "llvm/Support/SHA1.h" | ||||
#include "llvm/Support/raw_ostream.h" | #include "llvm/Support/raw_ostream.h" | ||||
#include <algorithm> | #include <algorithm> | ||||
#include <cassert> | #include <cassert> | ||||
▲ Show 20 Lines • Show All 3,747 Lines • ▼ Show 20 Lines | void ModuleBitcodeWriterBase::writePerModuleFunctionSummaryRecord( | ||||
FunctionSummary *FS = cast<FunctionSummary>(Summary); | FunctionSummary *FS = cast<FunctionSummary>(Summary); | ||||
writeFunctionTypeMetadataRecords( | writeFunctionTypeMetadataRecords( | ||||
Stream, FS, [&](const ValueInfo &VI) -> Optional<unsigned> { | Stream, FS, [&](const ValueInfo &VI) -> Optional<unsigned> { | ||||
return {VE.getValueID(VI.getValue())}; | return {VE.getValueID(VI.getValue())}; | ||||
}); | }); | ||||
dbgs() << "Mingming function name is "; | |||||
F.dump(); | |||||
dbgs() << "\n"; | |||||
auto SpecialRefCnts = FS->specialRefCounts(); | auto SpecialRefCnts = FS->specialRefCounts(); | ||||
dbgs() << "Mingming EncodedGVSummary index is " << NameVals.size() << "\n"; | |||||
NameVals.push_back(getEncodedGVSummaryFlags(FS->flags())); | NameVals.push_back(getEncodedGVSummaryFlags(FS->flags())); | ||||
dbgs() << "Mingming instCount index is " << NameVals.size() << "\n"; | |||||
NameVals.push_back(FS->instCount()); | NameVals.push_back(FS->instCount()); | ||||
dbgs() << "Mingming fflags index is " << NameVals.size() << "\n"; | |||||
NameVals.push_back(getEncodedFFlags(FS->fflags())); | NameVals.push_back(getEncodedFFlags(FS->fflags())); | ||||
dbgs() << "Mingming refCount index is " << NameVals.size() << "\n"; | |||||
NameVals.push_back(FS->refs().size()); | NameVals.push_back(FS->refs().size()); | ||||
dbgs() << "Mingming rorefcnt index is " << NameVals.size() << "\n"; | |||||
NameVals.push_back(SpecialRefCnts.first); // rorefcnt | NameVals.push_back(SpecialRefCnts.first); // rorefcnt | ||||
dbgs() << "Mingming worefcnt index is " << NameVals.size() << "\n"; | |||||
NameVals.push_back(SpecialRefCnts.second); // worefcnt | NameVals.push_back(SpecialRefCnts.second); // worefcnt | ||||
dbgs() << "Mingming isUnreachable function index is " << NameVals.size() | |||||
<< " and value is " << FS->isUnreachableFunction() << "\n"; | |||||
NameVals.push_back(FS->isUnreachableFunction() ? 1 : 0); | |||||
for (auto &RI : FS->refs()) | for (auto &RI : FS->refs()) | ||||
NameVals.push_back(VE.getValueID(RI.getValue())); | NameVals.push_back(VE.getValueID(RI.getValue())); | ||||
bool HasProfileData = | bool HasProfileData = | ||||
F.hasProfileData() || ForceSummaryEdgesCold != FunctionSummary::FSHT_None; | F.hasProfileData() || ForceSummaryEdgesCold != FunctionSummary::FSHT_None; | ||||
for (auto &ECI : FS->calls()) { | for (auto &ECI : FS->calls()) { | ||||
NameVals.push_back(getValueId(ECI.first)); | NameVals.push_back(getValueId(ECI.first)); | ||||
if (HasProfileData) | if (HasProfileData) | ||||
▲ Show 20 Lines • Show All 1,125 Lines • Show Last 20 Lines |