Skip to content

Commit bdc68ee

Browse files
committed
Revert "[InstrProf] Add Correlator class to read debug info"
Also reverts an attempt to fix the build errors https://reviews.llvm.org/D115911 The original diff https://reviews.llvm.org/D114566 causes some build errors that I need to investigate. https://lab.llvm.org/buildbot/#/builders/118/builds/7037 This reverts commit 95946d2. Reviewed By: kyulee Differential Revision: https://reviews.llvm.org/D115913
1 parent 59f1d0e commit bdc68ee

File tree

12 files changed

+65
-638
lines changed

12 files changed

+65
-638
lines changed

compiler-rt/test/profile/Darwin/instrprof-debug-info-correlate.c

Lines changed: 0 additions & 31 deletions
This file was deleted.

compiler-rt/test/profile/Linux/instrprof-debug-info-correlate.c

Lines changed: 0 additions & 31 deletions
This file was deleted.

llvm/include/llvm/ProfileData/InstrProf.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,6 @@ enum class instrprof_error {
290290
too_large,
291291
truncated,
292292
malformed,
293-
missing_debug_info_for_correlation,
294-
unexpected_debug_info_for_correlation,
295-
unable_to_correlate_profile,
296-
unsupported_debug_format,
297293
unknown_function,
298294
invalid_prof,
299295
hash_mismatch,

llvm/include/llvm/ProfileData/InstrProfCorrelator.h

Lines changed: 0 additions & 170 deletions
This file was deleted.

llvm/include/llvm/ProfileData/InstrProfReader.h

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "llvm/ADT/StringRef.h"
1919
#include "llvm/IR/ProfileSummary.h"
2020
#include "llvm/ProfileData/InstrProf.h"
21-
#include "llvm/ProfileData/InstrProfCorrelator.h"
2221
#include "llvm/Support/Endian.h"
2322
#include "llvm/Support/Error.h"
2423
#include "llvm/Support/LineIterator.h"
@@ -97,9 +96,6 @@ class InstrProfReader {
9796

9897
virtual bool instrEntryBBEnabled() const = 0;
9998

100-
/// Return true if we must provide debug info to create PGO profiles.
101-
virtual bool useDebugInfoCorrelate() const { return false; }
102-
10399
/// Return the PGO symtab. There are three different readers:
104100
/// Raw, Text, and Indexed profile readers. The first two types
105101
/// of readers are used only by llvm-profdata tool, while the indexed
@@ -154,12 +150,10 @@ class InstrProfReader {
154150

155151
/// Factory method to create an appropriately typed reader for the given
156152
/// instrprof file.
157-
static Expected<std::unique_ptr<InstrProfReader>>
158-
create(const Twine &Path, const InstrProfCorrelator *Correlator = nullptr);
153+
static Expected<std::unique_ptr<InstrProfReader>> create(const Twine &Path);
159154

160155
static Expected<std::unique_ptr<InstrProfReader>>
161-
create(std::unique_ptr<MemoryBuffer> Buffer,
162-
const InstrProfCorrelator *Correlator = nullptr);
156+
create(std::unique_ptr<MemoryBuffer> Buffer);
163157
};
164158

165159
/// Reader for the simple text based instrprof format.
@@ -221,9 +215,6 @@ class RawInstrProfReader : public InstrProfReader {
221215
private:
222216
/// The profile data file contents.
223217
std::unique_ptr<MemoryBuffer> DataBuffer;
224-
/// If available, this hold the ProfileData array used to correlate raw
225-
/// instrumentation data to their functions.
226-
const InstrProfCorrelatorImpl<IntPtrT> *Correlator;
227218
bool ShouldSwapBytes;
228219
// The value of the version field of the raw profile data header. The lower 56
229220
// bits specifies the format version and the most significant 8 bits specify
@@ -235,7 +226,7 @@ class RawInstrProfReader : public InstrProfReader {
235226
const RawInstrProf::ProfileData<IntPtrT> *DataEnd;
236227
const uint64_t *CountersStart;
237228
const char *NamesStart;
238-
const char *NamesEnd;
229+
uint64_t NamesSize;
239230
// After value profile is all read, this pointer points to
240231
// the header of next profile data (if exists)
241232
const uint8_t *ValueDataStart;
@@ -246,11 +237,8 @@ class RawInstrProfReader : public InstrProfReader {
246237
const uint8_t *BinaryIdsStart;
247238

248239
public:
249-
RawInstrProfReader(std::unique_ptr<MemoryBuffer> DataBuffer,
250-
const InstrProfCorrelator *Correlator)
251-
: DataBuffer(std::move(DataBuffer)),
252-
Correlator(dyn_cast_or_null<const InstrProfCorrelatorImpl<IntPtrT>>(
253-
Correlator)) {}
240+
RawInstrProfReader(std::unique_ptr<MemoryBuffer> DataBuffer)
241+
: DataBuffer(std::move(DataBuffer)) {}
254242
RawInstrProfReader(const RawInstrProfReader &) = delete;
255243
RawInstrProfReader &operator=(const RawInstrProfReader &) = delete;
256244

@@ -271,10 +259,6 @@ class RawInstrProfReader : public InstrProfReader {
271259
return (Version & VARIANT_MASK_INSTR_ENTRY) != 0;
272260
}
273261

274-
bool useDebugInfoCorrelate() const override {
275-
return (Version & VARIANT_MASK_DBG_CORRELATE) != 0;
276-
}
277-
278262
InstrProfSymtab &getSymtab() override {
279263
assert(Symtab.get());
280264
return *Symtab.get();

llvm/lib/ProfileData/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
add_llvm_component_library(LLVMProfileData
22
GCOV.cpp
33
InstrProf.cpp
4-
InstrProfCorrelator.cpp
54
InstrProfReader.cpp
65
InstrProfWriter.cpp
76
ProfileSummaryBuilder.cpp
@@ -20,8 +19,6 @@ add_llvm_component_library(LLVMProfileData
2019
Core
2120
Support
2221
Demangle
23-
Object
24-
DebugInfoDWARF
2522
)
2623

2724
add_subdirectory(Coverage)

llvm/lib/ProfileData/InstrProf.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,6 @@ static std::string getInstrProfErrString(instrprof_error Err,
110110
case instrprof_error::malformed:
111111
OS << "malformed instrumentation profile data";
112112
break;
113-
case instrprof_error::missing_debug_info_for_correlation:
114-
OS << "debug info for correlation is required";
115-
break;
116-
case instrprof_error::unexpected_debug_info_for_correlation:
117-
OS << "debug info for correlation is not necessary";
118-
break;
119-
case instrprof_error::unable_to_correlate_profile:
120-
OS << "unable to correlate profile";
121-
break;
122-
case instrprof_error::unsupported_debug_format:
123-
OS << "unsupported debug info format (only DWARF is supported)";
124-
break;
125113
case instrprof_error::invalid_prof:
126114
OS << "invalid profile created. Please file a bug "
127115
"at: " BUG_REPORT_URL

0 commit comments

Comments
 (0)