Skip to content

Commit c063c59

Browse files
committed
Rebase
Created using spr 1.3.6-beta.1
2 parents 55b7259 + a7ac431 commit c063c59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+133
-391
lines changed

compiler-rt/include/profile/MemProfData.inc

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@
3333
(uint64_t)'o' << 24 | (uint64_t)'f' << 16 | (uint64_t)'r' << 8 | (uint64_t)129)
3434

3535
// The version number of the raw binary format.
36-
#define MEMPROF_RAW_VERSION 5ULL
36+
#define MEMPROF_RAW_VERSION 4ULL
3737

3838
// Currently supported versions.
39-
#define MEMPROF_RAW_SUPPORTED_VERSIONS {3ULL, 4ULL, 5ULL}
39+
#define MEMPROF_RAW_SUPPORTED_VERSIONS \
40+
{ 3ULL, 4ULL }
4041

4142
#define MEMPROF_V3_MIB_SIZE 132ULL;
4243

@@ -228,41 +229,6 @@ void Merge(const MemInfoBlock &newMIB) {
228229
} __attribute__((__packed__));
229230
#endif
230231

231-
constexpr int MantissaBits = 12;
232-
constexpr int ExponentBits = 4;
233-
constexpr uint16_t MaxMantissa = (1U << MantissaBits) - 1;
234-
constexpr uint16_t MaxExponent = (1U << ExponentBits) - 1;
235-
constexpr uint64_t MaxRepresentableValue = static_cast<uint64_t>(MaxMantissa)
236-
<< MaxExponent;
237-
238-
// Encodes a 64-bit unsigned integer into a 16-bit scaled integer format.
239-
inline uint16_t encodeHistogramCount(uint64_t Count) {
240-
if (Count == 0)
241-
return 0;
242-
243-
if (Count > MaxRepresentableValue)
244-
Count = MaxRepresentableValue;
245-
246-
if (Count <= MaxMantissa)
247-
return Count;
248-
249-
uint64_t M = Count;
250-
uint16_t E = 0;
251-
while (M > MaxMantissa) {
252-
M = (M + 1) >> 1;
253-
E++;
254-
}
255-
return (E << MantissaBits) | static_cast<uint16_t>(M);
256-
}
257-
258-
// Decodes a 16-bit scaled integer and returns the
259-
// decoded 64-bit unsigned integer.
260-
inline uint64_t decodeHistogramCount(uint16_t EncodedValue) {
261-
const uint16_t E = EncodedValue >> MantissaBits;
262-
const uint16_t M = EncodedValue & MaxMantissa;
263-
return static_cast<uint64_t>(M) << E;
264-
}
265-
266232
} // namespace memprof
267233
} // namespace llvm
268234

compiler-rt/lib/memprof/memprof_rawprofile.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ using ::__sanitizer::Vector;
1919
using ::llvm::memprof::MemInfoBlock;
2020
using SegmentEntry = ::llvm::memprof::SegmentEntry;
2121
using Header = ::llvm::memprof::Header;
22-
using ::llvm::memprof::encodeHistogramCount;
2322

2423
namespace {
2524
template <class T> char *WriteBytes(const T &Pod, char *Buffer) {
@@ -170,15 +169,13 @@ void SerializeMIBInfoToBuffer(MIBMapTy &MIBMap, const Vector<u64> &StackIds,
170169
// FIXME: We unnecessarily serialize the AccessHistogram pointer. Adding a
171170
// serialization schema will fix this issue. See also FIXME in
172171
// deserialization.
173-
auto &MIB = (*h)->mib;
174-
Ptr = WriteBytes(MIB, Ptr);
175-
for (u64 j = 0; j < MIB.AccessHistogramSize; ++j) {
176-
u16 HistogramEntry =
177-
encodeHistogramCount(((u64 *)(MIB.AccessHistogram))[j]);
172+
Ptr = WriteBytes((*h)->mib, Ptr);
173+
for (u64 j = 0; j < (*h)->mib.AccessHistogramSize; ++j) {
174+
u64 HistogramEntry = ((u64 *)((*h)->mib.AccessHistogram))[j];
178175
Ptr = WriteBytes(HistogramEntry, Ptr);
179176
}
180-
if (MIB.AccessHistogramSize > 0) {
181-
InternalFree((void *)MIB.AccessHistogram);
177+
if ((*h)->mib.AccessHistogramSize > 0) {
178+
InternalFree((void *)((*h)->mib.AccessHistogram));
182179
}
183180
}
184181
CHECK(ExpectedNumBytes >= static_cast<u64>(Ptr - Buffer) &&
@@ -252,7 +249,7 @@ u64 SerializeToRawProfile(MIBMapTy &MIBMap, ArrayRef<LoadedModule> Modules,
252249
},
253250
reinterpret_cast<void *>(&TotalAccessHistogramEntries));
254251
const u64 NumHistogramBytes =
255-
RoundUpTo(TotalAccessHistogramEntries * sizeof(uint16_t), 8);
252+
RoundUpTo(TotalAccessHistogramEntries * sizeof(uint64_t), 8);
256253

257254
const u64 NumStackBytes = RoundUpTo(StackSizeBytes(StackIds), 8);
258255

compiler-rt/lib/memprof/tests/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ set(MEMPROF_SOURCES
2626
../memprof_rawprofile.cpp)
2727

2828
set(MEMPROF_UNITTESTS
29-
histogram_encoding.cpp
3029
rawprofile.cpp
3130
driver.cpp)
3231

compiler-rt/lib/memprof/tests/histogram_encoding.cpp

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

compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp

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

lldb/packages/Python/lldbsuite/test/builders/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@
88

99
def get_builder(platform):
1010
"""Returns a Builder instance for the given platform."""
11-
if platform == "darwin":
11+
if platform in [
12+
"bridgeos",
13+
"darwin",
14+
"ios",
15+
"macosx",
16+
"tvos",
17+
"watchos",
18+
"xros",
19+
]:
1220
from .darwin import BuilderDarwin
1321

1422
return BuilderDarwin()

lldb/packages/Python/lldbsuite/test/lldbplatformutil.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ def hasChattyStderr(test_case):
229229

230230

231231
def builder_module():
232-
return get_builder(sys.platform)
232+
"""Return the builder for the target platform."""
233+
return get_builder(getPlatform())
233234

234235

235236
def getArchitecture():

lldb/packages/Python/lldbsuite/test/lldbtest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ def build(
15171517
testname = self.getBuildDirBasename()
15181518

15191519
module = builder_module()
1520-
command = builder_module().getBuildCommand(
1520+
command = module.getBuildCommand(
15211521
debug_info,
15221522
architecture,
15231523
compiler,

llvm/include/llvm/LTO/LTO.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,12 @@ class LTO {
546546
// resolutions used by a single input module. Functions return ranges refering
547547
// to the resolutions for the remaining modules in the InputFile.
548548
Expected<ArrayRef<SymbolResolution>>
549-
addModule(InputFile &Input, unsigned ModI, ArrayRef<SymbolResolution> Res);
549+
addModule(InputFile &Input, ArrayRef<SymbolResolution> InputRes,
550+
unsigned ModI, ArrayRef<SymbolResolution> Res);
550551

551552
Expected<std::pair<RegularLTOState::AddedModule, ArrayRef<SymbolResolution>>>
552-
addRegularLTO(InputFile &Input, BitcodeModule BM,
553-
ArrayRef<InputFile::Symbol> Syms,
553+
addRegularLTO(InputFile &Input, ArrayRef<SymbolResolution> InputRes,
554+
BitcodeModule BM, ArrayRef<InputFile::Symbol> Syms,
554555
ArrayRef<SymbolResolution> Res);
555556
Error linkRegularLTO(RegularLTOState::AddedModule Mod,
556557
bool LivenessFromIndex);

llvm/include/llvm/ProfileData/MemProfData.inc

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@
3333
(uint64_t)'o' << 24 | (uint64_t)'f' << 16 | (uint64_t)'r' << 8 | (uint64_t)129)
3434

3535
// The version number of the raw binary format.
36-
#define MEMPROF_RAW_VERSION 5ULL
36+
#define MEMPROF_RAW_VERSION 4ULL
3737

3838
// Currently supported versions.
39-
#define MEMPROF_RAW_SUPPORTED_VERSIONS {3ULL, 4ULL, 5ULL}
39+
#define MEMPROF_RAW_SUPPORTED_VERSIONS \
40+
{ 3ULL, 4ULL }
4041

4142
#define MEMPROF_V3_MIB_SIZE 132ULL;
4243

@@ -228,41 +229,6 @@ void Merge(const MemInfoBlock &newMIB) {
228229
} __attribute__((__packed__));
229230
#endif
230231

231-
constexpr int MantissaBits = 12;
232-
constexpr int ExponentBits = 4;
233-
constexpr uint16_t MaxMantissa = (1U << MantissaBits) - 1;
234-
constexpr uint16_t MaxExponent = (1U << ExponentBits) - 1;
235-
constexpr uint64_t MaxRepresentableValue = static_cast<uint64_t>(MaxMantissa)
236-
<< MaxExponent;
237-
238-
// Encodes a 64-bit unsigned integer into a 16-bit scaled integer format.
239-
inline uint16_t encodeHistogramCount(uint64_t Count) {
240-
if (Count == 0)
241-
return 0;
242-
243-
if (Count > MaxRepresentableValue)
244-
Count = MaxRepresentableValue;
245-
246-
if (Count <= MaxMantissa)
247-
return Count;
248-
249-
uint64_t M = Count;
250-
uint16_t E = 0;
251-
while (M > MaxMantissa) {
252-
M = (M + 1) >> 1;
253-
E++;
254-
}
255-
return (E << MantissaBits) | static_cast<uint16_t>(M);
256-
}
257-
258-
// Decodes a 16-bit scaled integer and returns the
259-
// decoded 64-bit unsigned integer.
260-
inline uint64_t decodeHistogramCount(uint16_t EncodedValue) {
261-
const uint16_t E = EncodedValue >> MantissaBits;
262-
const uint16_t M = EncodedValue & MaxMantissa;
263-
return static_cast<uint64_t>(M) << E;
264-
}
265-
266232
} // namespace memprof
267233
} // namespace llvm
268234

0 commit comments

Comments
 (0)