mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Stats] Collect IR/LLVM always-on stats correctly when multithreading.
This commit is contained in:
@@ -67,7 +67,6 @@
|
||||
#include "llvm/ADT/Statistic.h"
|
||||
#include "llvm/IR/LLVMContext.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/IR/ValueSymbolTable.h"
|
||||
#include "llvm/IRReader/IRReader.h"
|
||||
#include "llvm/Option/Option.h"
|
||||
#include "llvm/Option/OptTable.h"
|
||||
@@ -463,25 +462,6 @@ static void countStatsPostSema(UnifiedStatsReporter &Stats,
|
||||
}
|
||||
}
|
||||
|
||||
static void countStatsPostIRGen(UnifiedStatsReporter &Stats,
|
||||
const llvm::Module& Module) {
|
||||
auto &C = Stats.getFrontendCounters();
|
||||
// FIXME: calculate these in constant time if possible.
|
||||
C.NumIRGlobals = Module.getGlobalList().size();
|
||||
C.NumIRFunctions = Module.getFunctionList().size();
|
||||
C.NumIRAliases = Module.getAliasList().size();
|
||||
C.NumIRIFuncs = Module.getIFuncList().size();
|
||||
C.NumIRNamedMetaData = Module.getNamedMDList().size();
|
||||
C.NumIRValueSymbols = Module.getValueSymbolTable().size();
|
||||
C.NumIRComdatSymbols = Module.getComdatSymbolTable().size();
|
||||
for (auto const &Func : Module) {
|
||||
for (auto const &BB : Func) {
|
||||
C.NumIRBasicBlocks++;
|
||||
C.NumIRInsts += BB.size();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void countStatsPostSILGen(UnifiedStatsReporter &Stats,
|
||||
const SILModule& Module) {
|
||||
auto &C = Stats.getFrontendCounters();
|
||||
@@ -1027,10 +1007,6 @@ static bool performCompile(CompilerInstance &Instance,
|
||||
return HadError;
|
||||
}
|
||||
|
||||
if (Stats) {
|
||||
countStatsPostIRGen(*Stats, *IRModule);
|
||||
}
|
||||
|
||||
bool allSymbols = false;
|
||||
switch (opts.ValidateTBDAgainstIR) {
|
||||
case FrontendOptions::TBDValidationMode::None:
|
||||
|
||||
Reference in New Issue
Block a user