Skip to content

Commit 9eba6b2

Browse files
committed
Revert "[Modules] Add stats to measure performance of building and loading modules."
This reverts commit c4bacc3. Test "LLVM :: ThinLTO/X86/funcimport-stats.ll" is failing. Reverting now and will recommit after making the test not fail with the added stats.
1 parent 0a349d5 commit 9eba6b2

File tree

6 files changed

+2
-41
lines changed

6 files changed

+2
-41
lines changed

clang/lib/Frontend/CompilerInstance.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@
5555

5656
using namespace clang;
5757

58-
#define DEBUG_TYPE "modules"
59-
60-
ALWAYS_ENABLED_STATISTIC(NumCompiledModules, "Number of compiled modules.");
61-
6258
CompilerInstance::CompilerInstance(
6359
std::shared_ptr<PCHContainerOperations> PCHContainerOps,
6460
InMemoryModuleCache *SharedModuleCache)
@@ -1067,7 +1063,6 @@ compileModuleImpl(CompilerInstance &ImportingInstance, SourceLocation ImportLoc,
10671063
llvm::function_ref<void(CompilerInstance &)> PostBuildStep =
10681064
[](CompilerInstance &) {}) {
10691065
llvm::TimeTraceScope TimeScope("Module Compile", ModuleName);
1070-
++NumCompiledModules;
10711066

10721067
// Construct a compiler invocation for creating this module.
10731068
auto Invocation =

clang/lib/Serialization/ASTReader.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
#include "llvm/ADT/SmallPtrSet.h"
101101
#include "llvm/ADT/SmallString.h"
102102
#include "llvm/ADT/SmallVector.h"
103-
#include "llvm/ADT/Statistic.h"
104103
#include "llvm/ADT/StringExtras.h"
105104
#include "llvm/ADT/StringMap.h"
106105
#include "llvm/ADT/StringRef.h"
@@ -143,15 +142,6 @@ using namespace clang::serialization::reader;
143142
using llvm::BitstreamCursor;
144143
using llvm::RoundingMode;
145144

146-
#define DEBUG_TYPE "modules"
147-
148-
ALWAYS_ENABLED_STATISTIC(NumTryLoadModule, "Number of times tried to load a "
149-
"module. Includes failed attempts "
150-
"and using cached results.");
151-
ALWAYS_ENABLED_STATISTIC(NumReadASTCore,
152-
"Number of ReadASTCore() invocations. Includes only "
153-
"actual AST core parsing and ignores cached results.");
154-
155145
//===----------------------------------------------------------------------===//
156146
// ChainedASTReaderListener implementation
157147
//===----------------------------------------------------------------------===//
@@ -4213,7 +4203,6 @@ ASTReader::ASTReadResult ASTReader::ReadAST(StringRef FileName,
42134203
SourceLocation ImportLoc,
42144204
unsigned ClientLoadCapabilities,
42154205
SmallVectorImpl<ImportedSubmodule> *Imported) {
4216-
++NumTryLoadModule;
42174206
llvm::SaveAndRestore<SourceLocation>
42184207
SetCurImportLocRAII(CurrentImportLoc, ImportLoc);
42194208

@@ -4563,7 +4552,6 @@ ASTReader::ReadASTCore(StringRef FileName,
45634552
return Failure;
45644553
}
45654554

4566-
++NumReadASTCore;
45674555
// This is used for compatibility with older PCH formats.
45684556
bool HaveReadControlBlock = false;
45694557
while (true) {

llvm/lib/Support/MemoryBuffer.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#include "llvm/Support/MemoryBuffer.h"
1414
#include "llvm/ADT/SmallString.h"
15-
#include "llvm/ADT/Statistic.h"
1615
#include "llvm/Config/config.h"
1716
#include "llvm/Support/Errc.h"
1817
#include "llvm/Support/Errno.h"
@@ -35,12 +34,6 @@
3534
#endif
3635
using namespace llvm;
3736

38-
#define DEBUG_TYPE "memory-buffer"
39-
40-
ALWAYS_ENABLED_STATISTIC(NumMmapFile, "Number of mmap-ed files.");
41-
ALWAYS_ENABLED_STATISTIC(NumAllocFile,
42-
"Number of files read into allocated memory buffer.");
43-
4437
//===----------------------------------------------------------------------===//
4538
// MemoryBuffer implementation itself.
4639
//===----------------------------------------------------------------------===//
@@ -456,10 +449,8 @@ getOpenFileImpl(sys::fs::file_t FD, const Twine &Filename, uint64_t FileSize,
456449
// buffer by copying off the stream.
457450
sys::fs::file_type Type = Status.type();
458451
if (Type != sys::fs::file_type::regular_file &&
459-
Type != sys::fs::file_type::block_file) {
460-
++NumAllocFile;
452+
Type != sys::fs::file_type::block_file)
461453
return getMemoryBufferForStream(FD, Filename);
462-
}
463454

464455
FileSize = Status.getSize();
465456
}
@@ -472,10 +463,8 @@ getOpenFileImpl(sys::fs::file_t FD, const Twine &Filename, uint64_t FileSize,
472463
std::unique_ptr<MB> Result(
473464
new (NamedBufferAlloc(Filename)) MemoryBufferMMapFile<MB>(
474465
RequiresNullTerminator, FD, MapSize, Offset, EC));
475-
if (!EC) {
476-
++NumMmapFile;
466+
if (!EC)
477467
return std::move(Result);
478-
}
479468
}
480469

481470
auto Buf = WritableMemoryBuffer::getNewUninitMemBuffer(MapSize, Filename);
@@ -486,7 +475,6 @@ getOpenFileImpl(sys::fs::file_t FD, const Twine &Filename, uint64_t FileSize,
486475
}
487476

488477
// Read until EOF, zero-initialize the rest.
489-
++NumAllocFile;
490478
MutableArrayRef<char> ToRead = Buf->getBuffer();
491479
while (!ToRead.empty()) {
492480
Expected<size_t> ReadBytes =

llvm/lib/Support/Path.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#include "llvm/Support/Path.h"
1414
#include "llvm/ADT/ArrayRef.h"
15-
#include "llvm/ADT/Statistic.h"
1615
#include "llvm/Config/llvm-config.h"
1716
#include "llvm/Support/Endian.h"
1817
#include "llvm/Support/Errc.h"
@@ -32,10 +31,6 @@
3231
using namespace llvm;
3332
using namespace llvm::support::endian;
3433

35-
#define DEBUG_TYPE "file-system"
36-
37-
ALWAYS_ENABLED_STATISTIC(NumStatusCalls, "Number of `status` calls.");
38-
3934
namespace {
4035
using llvm::StringRef;
4136
using llvm::sys::path::is_separator;

llvm/lib/Support/Unix/Path.inc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,6 @@ static std::error_code fillStatus(int StatRet, const struct stat &Status,
736736
}
737737

738738
std::error_code status(const Twine &Path, file_status &Result, bool Follow) {
739-
++NumStatusCalls;
740739
SmallString<128> PathStorage;
741740
StringRef P = Path.toNullTerminatedStringRef(PathStorage);
742741

@@ -746,7 +745,6 @@ std::error_code status(const Twine &Path, file_status &Result, bool Follow) {
746745
}
747746

748747
std::error_code status(int FD, file_status &Result) {
749-
++NumStatusCalls;
750748
struct stat Status;
751749
int StatRet = ::fstat(FD, &Status);
752750
return fillStatus(StatRet, Status, Result);

llvm/lib/Support/Windows/Path.inc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,6 @@ handle_status_error:
710710
}
711711

712712
std::error_code status(const Twine &path, file_status &result, bool Follow) {
713-
++NumStatusCalls;
714713
SmallString<128> path_storage;
715714
SmallVector<wchar_t, 128> path_utf16;
716715

@@ -743,13 +742,11 @@ std::error_code status(const Twine &path, file_status &result, bool Follow) {
743742
}
744743

745744
std::error_code status(int FD, file_status &Result) {
746-
++NumStatusCalls;
747745
HANDLE FileHandle = reinterpret_cast<HANDLE>(_get_osfhandle(FD));
748746
return getStatus(FileHandle, Result);
749747
}
750748

751749
std::error_code status(file_t FileHandle, file_status &Result) {
752-
++NumStatusCalls;
753750
return getStatus(FileHandle, Result);
754751
}
755752

0 commit comments

Comments
 (0)