Skip to content

Commit fb5b04b

Browse files
committed
Merge from 'main' to 'sycl-web' (202 commits)
CONFLICT (content): Merge conflict in clang/lib/Driver/Driver.cpp
2 parents 7bb5f5c + f5e499a commit fb5b04b

File tree

928 files changed

+27823
-11707
lines changed

Some content is hidden

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

928 files changed

+27823
-11707
lines changed

.ci/monolithic-linux.sh

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -102,51 +102,25 @@ if [[ "${runtimes}" != "" ]]; then
102102
exit 1
103103
fi
104104

105-
echo "--- ninja install-clang"
106-
107-
ninja -C ${BUILD_DIR} install-clang install-clang-resource-headers
108-
109-
RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes"
110-
INSTALL_DIR="${BUILD_DIR}/install"
111-
mkdir -p ${RUNTIMES_BUILD_DIR}
112-
113105
echo "--- cmake runtimes C++26"
114106

115-
rm -rf "${RUNTIMES_BUILD_DIR}"
116-
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
117-
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
118-
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
119-
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
120-
-D LIBCXX_CXX_ABI=libcxxabi \
121-
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
122-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
123-
-D LIBCXX_TEST_PARAMS="std=c++26" \
124-
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
125-
-D LLVM_LIT_ARGS="${lit_args}"
107+
cmake \
108+
-D LIBCXX_TEST_PARAMS="std=c++26" \
109+
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
110+
"${BUILD_DIR}"
126111

127112
echo "--- ninja runtimes C++26"
128113

129-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
114+
ninja -C "${BUILD_DIR}" ${runtime_targets}
130115

131116
echo "--- cmake runtimes clang modules"
132117

133-
# We don't need to do a clean build of runtimes, because LIBCXX_TEST_PARAMS
134-
# and LIBCXXABI_TEST_PARAMS only affect lit configuration, which successfully
135-
# propagates without a clean build. Other that those two variables, builds
136-
# are supposed to be the same.
137-
138-
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
139-
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
140-
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
141-
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
142-
-D LIBCXX_CXX_ABI=libcxxabi \
143-
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
144-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
145-
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
146-
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
147-
-D LLVM_LIT_ARGS="${lit_args}"
118+
cmake \
119+
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
120+
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
121+
"${BUILD_DIR}"
148122

149123
echo "--- ninja runtimes clang modules"
150124

151-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
125+
ninja -C "${BUILD_DIR}" ${runtime_targets}
152126
fi

.git-blame-ignore-revs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,9 @@ d33bf2e9df578ff7e44fd22504d6ad5a122b7ee6
100100

101101
# [lldb][NFC] clang-format MainLoopPosix.cpp
102102
66bdbfbaa08fa3d8e64a7fe136a8fb717f5cdbb7
103+
104+
# [clang-tidy][NFC] Run clang-format on "clang-tools-extra/clang-tidy"
105+
65d66625b3e2b8322ed99d82edabecbafcd0885b
106+
ce46adb8b7ce645353eccaedf31ed9765dab77bb
107+
68070f908bb7ac5f0b5fa9722caa504ecf723f6b
108+
5213c57cb1f0d78aad9a253b7f6a2b62ff4c7859

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ class MCPlusBuilder {
405405

406406
bool equals(const MCExpr &A, const MCExpr &B, CompFuncTy Comp) const;
407407

408-
virtual bool equals(const MCTargetExpr &A, const MCTargetExpr &B,
408+
virtual bool equals(const MCSpecifierExpr &A, const MCSpecifierExpr &B,
409409
CompFuncTy Comp) const;
410410

411411
virtual bool isBranch(const MCInst &Inst) const {

bolt/include/bolt/Profile/DataAggregator.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ class DataAggregator : public DataReader {
7878
static bool checkPerfDataMagic(StringRef FileName);
7979

8080
private:
81+
struct LBREntry {
82+
uint64_t From;
83+
uint64_t To;
84+
bool Mispred;
85+
};
86+
friend raw_ostream &operator<<(raw_ostream &OS, const LBREntry &);
87+
8188
struct PerfBranchSample {
8289
SmallVector<LBREntry, 32> LBR;
8390
};
@@ -476,7 +483,6 @@ class DataAggregator : public DataReader {
476483

477484
/// Debugging dump methods
478485
void dump() const;
479-
void dump(const LBREntry &LBR) const;
480486
void dump(const PerfBranchSample &Sample) const;
481487
void dump(const PerfMemSample &Sample) const;
482488

@@ -504,6 +510,12 @@ class DataAggregator : public DataReader {
504510

505511
friend class YAMLProfileWriter;
506512
};
513+
514+
inline raw_ostream &operator<<(raw_ostream &OS,
515+
const DataAggregator::LBREntry &L) {
516+
OS << formatv("{0:x} -> {1:x}/{2}", L.From, L.To, L.Mispred ? 'M' : 'P');
517+
return OS;
518+
}
507519
} // namespace bolt
508520
} // namespace llvm
509521

bolt/include/bolt/Profile/DataReader.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,6 @@ namespace bolt {
3232

3333
class BinaryFunction;
3434

35-
struct LBREntry {
36-
uint64_t From;
37-
uint64_t To;
38-
bool Mispred;
39-
};
40-
41-
inline raw_ostream &operator<<(raw_ostream &OS, const LBREntry &LBR) {
42-
OS << "0x" << Twine::utohexstr(LBR.From) << " -> 0x"
43-
<< Twine::utohexstr(LBR.To);
44-
return OS;
45-
}
46-
4735
struct Location {
4836
bool IsSymbol;
4937
StringRef Name;

bolt/lib/Core/HashUtilities.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ std::string hashExpr(BinaryContext &BC, const MCExpr &Expr) {
6767
.append(hashInteger(BinaryExpr.getOpcode()))
6868
.append(hashExpr(BC, *BinaryExpr.getRHS()));
6969
}
70+
case MCExpr::Specifier:
7071
case MCExpr::Target:
7172
return std::string();
7273
}

bolt/lib/Core/MCPlusBuilder.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,19 @@ bool MCPlusBuilder::equals(const MCExpr &A, const MCExpr &B,
114114
equals(*BinaryA.getRHS(), *BinaryB.getRHS(), Comp);
115115
}
116116

117-
case MCExpr::Target: {
118-
const auto &TargetExprA = cast<MCTargetExpr>(A);
119-
const auto &TargetExprB = cast<MCTargetExpr>(B);
117+
case MCExpr::Specifier: {
118+
const auto &TargetExprA = cast<MCSpecifierExpr>(A);
119+
const auto &TargetExprB = cast<MCSpecifierExpr>(B);
120120
return equals(TargetExprA, TargetExprB, Comp);
121121
}
122+
case MCExpr::Target:
123+
llvm_unreachable("Not implemented");
122124
}
123125

124126
llvm_unreachable("Invalid expression kind!");
125127
}
126128

127-
bool MCPlusBuilder::equals(const MCTargetExpr &A, const MCTargetExpr &B,
129+
bool MCPlusBuilder::equals(const MCSpecifierExpr &A, const MCSpecifierExpr &B,
128130
CompFuncTy Comp) const {
129131
llvm_unreachable("target-specific expressions are unsupported");
130132
}

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 13 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,10 @@ void DataAggregator::processProfile(BinaryContext &BC) {
580580
}
581581
}
582582

583-
for (auto &FuncBranches : NamesToBranches)
583+
for (auto &FuncBranches : NamesToBranches) {
584584
llvm::stable_sort(FuncBranches.second.Data);
585+
llvm::stable_sort(FuncBranches.second.EntryData);
586+
}
585587

586588
for (auto &MemEvents : NamesToMemEvents)
587589
llvm::stable_sort(MemEvents.second.Data);
@@ -733,8 +735,10 @@ bool DataAggregator::doBranch(uint64_t From, uint64_t To, uint64_t Count,
733735
// corresponds to a return (if \p IsFrom) or a call continuation (otherwise).
734736
auto handleAddress = [&](uint64_t &Addr, bool IsFrom) {
735737
BinaryFunction *Func = getBinaryFunctionContainingAddress(Addr);
736-
if (!Func)
738+
if (!Func) {
739+
Addr = 0;
737740
return std::pair{Func, false};
741+
}
738742

739743
Addr -= Func->getAddress();
740744

@@ -972,7 +976,7 @@ bool DataAggregator::recordExit(BinaryFunction &BF, uint64_t From, bool Mispred,
972976
return true;
973977
}
974978

975-
ErrorOr<LBREntry> DataAggregator::parseLBREntry() {
979+
ErrorOr<DataAggregator::LBREntry> DataAggregator::parseLBREntry() {
976980
LBREntry Res;
977981
ErrorOr<StringRef> FromStrRes = parseString('/');
978982
if (std::error_code EC = FromStrRes.getError())
@@ -1430,54 +1434,16 @@ void DataAggregator::parseLBRSample(const PerfBranchSample &Sample,
14301434
const uint64_t TraceTo = NextLBR->From;
14311435
const BinaryFunction *TraceBF =
14321436
getBinaryFunctionContainingAddress(TraceFrom);
1433-
if (opts::HeatmapMode == opts::HeatmapModeKind::HM_Exclusive) {
1434-
FTInfo &Info = FallthroughLBRs[Trace(TraceFrom, TraceTo)];
1437+
FTInfo &Info = FallthroughLBRs[Trace(TraceFrom, TraceTo)];
1438+
if (TraceBF && TraceBF->containsAddress(LBR.From))
14351439
++Info.InternCount;
1436-
} else if (TraceBF && TraceBF->containsAddress(TraceTo)) {
1437-
FTInfo &Info = FallthroughLBRs[Trace(TraceFrom, TraceTo)];
1438-
if (TraceBF->containsAddress(LBR.From))
1439-
++Info.InternCount;
1440-
else
1441-
++Info.ExternCount;
1442-
} else {
1443-
const BinaryFunction *ToFunc =
1444-
getBinaryFunctionContainingAddress(TraceTo);
1445-
if (TraceBF && ToFunc) {
1446-
LLVM_DEBUG({
1447-
dbgs() << "Invalid trace starting in " << TraceBF->getPrintName()
1448-
<< formatv(" @ {0:x}", TraceFrom - TraceBF->getAddress())
1449-
<< formatv(" and ending @ {0:x}\n", TraceTo);
1450-
});
1451-
++NumInvalidTraces;
1452-
} else {
1453-
LLVM_DEBUG({
1454-
dbgs() << "Out of range trace starting in "
1455-
<< (TraceBF ? TraceBF->getPrintName() : "None")
1456-
<< formatv(" @ {0:x}",
1457-
TraceFrom - (TraceBF ? TraceBF->getAddress() : 0))
1458-
<< " and ending in "
1459-
<< (ToFunc ? ToFunc->getPrintName() : "None")
1460-
<< formatv(" @ {0:x}\n",
1461-
TraceTo - (ToFunc ? ToFunc->getAddress() : 0));
1462-
});
1463-
++NumLongRangeTraces;
1464-
}
1465-
}
1440+
else
1441+
++Info.ExternCount;
14661442
++NumTraces;
14671443
}
14681444
NextLBR = &LBR;
14691445

1470-
// Record branches outside binary functions for heatmap.
1471-
if (opts::HeatmapMode == opts::HeatmapModeKind::HM_Exclusive) {
1472-
TakenBranchInfo &Info = BranchLBRs[Trace(LBR.From, LBR.To)];
1473-
++Info.TakenCount;
1474-
continue;
1475-
}
1476-
uint64_t From = getBinaryFunctionContainingAddress(LBR.From) ? LBR.From : 0;
1477-
uint64_t To = getBinaryFunctionContainingAddress(LBR.To) ? LBR.To : 0;
1478-
if (!From && !To)
1479-
continue;
1480-
TakenBranchInfo &Info = BranchLBRs[Trace(From, To)];
1446+
TakenBranchInfo &Info = BranchLBRs[Trace(LBR.From, LBR.To)];
14811447
++Info.TakenCount;
14821448
Info.MispredCount += LBR.Mispred;
14831449
}
@@ -2398,16 +2364,10 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
23982364

23992365
void DataAggregator::dump() const { DataReader::dump(); }
24002366

2401-
void DataAggregator::dump(const LBREntry &LBR) const {
2402-
Diag << "From: " << Twine::utohexstr(LBR.From)
2403-
<< " To: " << Twine::utohexstr(LBR.To) << " Mispred? " << LBR.Mispred
2404-
<< "\n";
2405-
}
2406-
24072367
void DataAggregator::dump(const PerfBranchSample &Sample) const {
24082368
Diag << "Sample LBR entries: " << Sample.LBR.size() << "\n";
24092369
for (const LBREntry &LBR : Sample.LBR)
2410-
dump(LBR);
2370+
Diag << LBR << '\n';
24112371
}
24122372

24132373
void DataAggregator::dump(const PerfMemSample &Sample) const {

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
177177
return true;
178178
}
179179

180-
bool equals(const MCTargetExpr &A, const MCTargetExpr &B,
180+
bool equals(const MCSpecifierExpr &A, const MCSpecifierExpr &B,
181181
CompFuncTy Comp) const override {
182182
const auto &AArch64ExprA = cast<AArch64MCExpr>(A);
183183
const auto &AArch64ExprB = cast<AArch64MCExpr>(B);

bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
3131
public:
3232
using MCPlusBuilder::MCPlusBuilder;
3333

34-
bool equals(const MCTargetExpr &A, const MCTargetExpr &B,
34+
bool equals(const MCSpecifierExpr &A, const MCSpecifierExpr &B,
3535
CompFuncTy Comp) const override {
3636
const auto &RISCVExprA = cast<RISCVMCExpr>(A);
3737
const auto &RISCVExprB = cast<RISCVMCExpr>(B);

0 commit comments

Comments
 (0)