record llvm cgu instruction stats
This commit is contained in:
parent
07c993eba8
commit
a30de6e7cb
6 changed files with 41 additions and 0 deletions
|
@ -1751,6 +1751,19 @@ LLVMRustModuleCost(LLVMModuleRef M) {
|
|||
return std::distance(std::begin(f), std::end(f));
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
LLVMRustModuleInstructionStats(LLVMModuleRef M, RustStringRef Str)
|
||||
{
|
||||
RawRustStringOstream OS(Str);
|
||||
llvm::json::OStream JOS(OS);
|
||||
auto Module = unwrap(M);
|
||||
|
||||
JOS.object([&] {
|
||||
JOS.attribute("module", Module->getName());
|
||||
JOS.attribute("total", Module->getInstructionCount());
|
||||
});
|
||||
}
|
||||
|
||||
// Vector reductions:
|
||||
extern "C" LLVMValueRef
|
||||
LLVMRustBuildVectorReduceFAdd(LLVMBuilderRef B, LLVMValueRef Acc, LLVMValueRef Src) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue