Skip to content

Commit c96051c

Browse files
committed
Merge from 'main' to 'sycl-web' (164 commits)
CONFLICT (content): Merge conflict in clang/lib/CodeGen/BackendUtil.cpp
2 parents 11efe63 + ab3430f commit c96051c

File tree

678 files changed

+75853
-48162
lines changed

Some content is hidden

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

678 files changed

+75853
-48162
lines changed

.github/workflows/release-binaries.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
description: 'Tag to build'
1616
required: true
1717
type: string
18+
schedule:
19+
# * is a special character in YAML so you have to quote this string
20+
- cron: '0 8 1 * *'
1821

1922
permissions:
2023
contents: read # Default everything to read-only
@@ -26,7 +29,7 @@ jobs:
2629
if: github.repository == 'llvm/llvm-project'
2730
outputs:
2831
release-version: ${{ steps.validate-tag.outputs.release-version }}
29-
release: ${{ steps.validate-tag.outputs.release }}
32+
flags: ${{ steps.validate-tag.outputs.flags }}
3033
build-dir: ${{ steps.validate-tag.outputs.build-dir }}
3134
rc-flags: ${{ steps.validate-tag.outputs.rc-flags }}
3235
ref: ${{ steps.validate-tag.outputs.ref }}
@@ -50,6 +53,11 @@ jobs:
5053
tag="${{ github.ref_name }}"
5154
trimmed=$(echo ${{ inputs.tag }} | xargs)
5255
[[ "$trimmed" != "" ]] && tag="$trimmed"
56+
if [ "$tag" = "main" ]; then
57+
# If tag is main, then we've been triggered by a scheduled so pass so
58+
# use the head commit as the tag.
59+
tag=`git rev-parse HEAD`
60+
fi
5361
if [ -n "${{ inputs.upload }}" ]; then
5462
upload="${{ inputs.upload }}"
5563
else
@@ -71,7 +79,7 @@ jobs:
7179
- name: Checkout LLVM
7280
uses: actions/checkout@v4
7381
with:
74-
ref: ${{ inputs.tag || github.ref_name }}
82+
ref: ${{ needs.prepare.outputs.ref }}
7583

7684
- name: Install Ninja
7785
uses: llvm/actions/install-ninja@main
@@ -140,8 +148,7 @@ jobs:
140148
- name: Build and test release
141149
run: |
142150
${{ needs.prepare.outputs.build-dir }}/llvm-project/llvm/utils/release/test-release.sh \
143-
-release ${{ needs.prepare.outputs.release }} \
144-
${{ needs.prepare.outputs.rc-flags }} \
151+
${{ needs.prepare.outputs.flags }} \
145152
-triple ${{ matrix.target.triple }} \
146153
-use-ninja \
147154
-no-checkout \

.github/workflows/set-release-binary-outputs.sh

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,32 @@ if [[ "$github_user" != "tstellar" && "$github_user" != "tru" ]]; then
1616
echo "ERROR: User not allowed: $github_user"
1717
exit 1
1818
fi
19-
pattern='^llvmorg-[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc[0-9]\+\)\?$'
20-
echo "$tag" | grep -e $pattern
21-
if [ $? != 0 ]; then
22-
echo "ERROR: Tag '$tag' doesn't match pattern: $pattern"
23-
exit 1
19+
20+
if echo $tag | grep -e '^[0-9a-f]\+$'; then
21+
# This is a plain commit.
22+
# TODO: Don't hardcode this.
23+
release_version="18"
24+
build_dir="$tag"
25+
upload='false'
26+
ref="$tag"
27+
flags="-git-ref $tag -test-asserts"
28+
29+
else
30+
31+
pattern='^llvmorg-[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc[0-9]\+\)\?$'
32+
echo "$tag" | grep -e $pattern
33+
if [ $? != 0 ]; then
34+
echo "ERROR: Tag '$tag' doesn't match pattern: $pattern"
35+
exit 1
36+
fi
37+
release_version=`echo "$tag" | sed 's/llvmorg-//g'`
38+
release=`echo "$release_version" | sed 's/-.*//g'`
39+
build_dir=`echo "$release_version" | sed 's,^[^-]\+,final,' | sed 's,[^-]\+-rc\(.\+\),rc\1,'`
40+
rc_flags=`echo "$release_version" | sed 's,^[^-]\+,-final,' | sed 's,[^-]\+-rc\(.\+\),-rc \1 -test-asserts,' | sed 's,--,-,'`
41+
flags="-release $release $rc_flags"
2442
fi
25-
release_version=`echo "$tag" | sed 's/llvmorg-//g'`
26-
release=`echo "$release_version" | sed 's/-.*//g'`
27-
build_dir=`echo "$release_version" | sed 's,^[^-]\+,final,' | sed 's,[^-]\+-rc\(.\+\),rc\1,'`
28-
rc_flags=`echo "$release_version" | sed 's,^[^-]\+,-final,' | sed 's,[^-]\+-rc\(.\+\),-rc \1 -test-asserts,' | sed 's,--,-,'`
2943
echo "release-version=$release_version" >> $GITHUB_OUTPUT
30-
echo "release=$release" >> $GITHUB_OUTPUT
3144
echo "build-dir=$build_dir" >> $GITHUB_OUTPUT
32-
echo "rc-flags=$rc_flags" >> $GITHUB_OUTPUT
45+
echo "flags=$flags" >> $GITHUB_OUTPUT
3346
echo "upload=$upload" >> $GITHUB_OUTPUT
3447
echo "ref=$tag" >> $GITHUB_OUTPUT

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,8 +900,8 @@ class BinaryContext {
900900
/// Return true if \p SymbolName was generated internally and was not present
901901
/// in the input binary.
902902
bool isInternalSymbolName(const StringRef Name) {
903-
return Name.startswith("SYMBOLat") || Name.startswith("DATAat") ||
904-
Name.startswith("HOLEat");
903+
return Name.starts_with("SYMBOLat") || Name.starts_with("DATAat") ||
904+
Name.starts_with("HOLEat");
905905
}
906906

907907
MCSymbol *getHotTextStartSymbol() const {

bolt/lib/Core/BinaryContext.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ void BinaryContext::generateSymbolHashes() {
10861086
auto isPadding = [](const BinaryData &BD) {
10871087
StringRef Contents = BD.getSection().getContents();
10881088
StringRef SymData = Contents.substr(BD.getOffset(), BD.getSize());
1089-
return (BD.getName().startswith("HOLEat") ||
1089+
return (BD.getName().starts_with("HOLEat") ||
10901090
SymData.find_first_not_of(0) == StringRef::npos);
10911091
};
10921092

@@ -1326,8 +1326,8 @@ void BinaryContext::postProcessSymbolTable() {
13261326
bool Valid = true;
13271327
for (auto &Entry : BinaryDataMap) {
13281328
BinaryData *BD = Entry.second;
1329-
if ((BD->getName().startswith("SYMBOLat") ||
1330-
BD->getName().startswith("DATAat")) &&
1329+
if ((BD->getName().starts_with("SYMBOLat") ||
1330+
BD->getName().starts_with("DATAat")) &&
13311331
!BD->getParent() && !BD->getSize() && !BD->isAbsolute() &&
13321332
BD->getSection()) {
13331333
errs() << "BOLT-WARNING: zero-sized top level symbol: " << *BD << "\n";
@@ -1410,9 +1410,9 @@ void BinaryContext::fixBinaryDataHoles() {
14101410
auto isNotHole = [&Section](const binary_data_iterator &Itr) {
14111411
BinaryData *BD = Itr->second;
14121412
bool isHole = (!BD->getParent() && !BD->getSize() && BD->isObject() &&
1413-
(BD->getName().startswith("SYMBOLat0x") ||
1414-
BD->getName().startswith("DATAat0x") ||
1415-
BD->getName().startswith("ANONYMOUS")));
1413+
(BD->getName().starts_with("SYMBOLat0x") ||
1414+
BD->getName().starts_with("DATAat0x") ||
1415+
BD->getName().starts_with("ANONYMOUS")));
14161416
return !isHole && BD->getSection() == Section && !BD->getParent();
14171417
};
14181418

@@ -1818,14 +1818,14 @@ MarkerSymType BinaryContext::getMarkerType(const SymbolRef &Symbol) const {
18181818
if (*TypeOrError != SymbolRef::ST_Unknown)
18191819
return MarkerSymType::NONE;
18201820

1821-
if (*NameOrError == "$x" || NameOrError->startswith("$x."))
1821+
if (*NameOrError == "$x" || NameOrError->starts_with("$x."))
18221822
return MarkerSymType::CODE;
18231823

18241824
// $x<ISA>
1825-
if (isRISCV() && NameOrError->startswith("$x"))
1825+
if (isRISCV() && NameOrError->starts_with("$x"))
18261826
return MarkerSymType::CODE;
18271827

1828-
if (*NameOrError == "$d" || NameOrError->startswith("$d."))
1828+
if (*NameOrError == "$d" || NameOrError->starts_with("$d."))
18291829
return MarkerSymType::DATA;
18301830

18311831
return MarkerSymType::NONE;

bolt/lib/Core/BinaryData.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ bool BinaryData::hasNameRegex(StringRef NameRegex) const {
6565

6666
bool BinaryData::nameStartsWith(StringRef Prefix) const {
6767
for (const MCSymbol *Symbol : Symbols)
68-
if (Symbol->getName().startswith(Prefix))
68+
if (Symbol->getName().starts_with(Prefix))
6969
return true;
7070
return false;
7171
}

bolt/lib/Passes/IndirectCallPromotion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ IndirectCallPromotion::maybeGetHotJumpTableTargets(BinaryBasicBlock &BB,
460460

461461
if (AccessInfo.MemoryObject) {
462462
// Deal with bad/stale data
463-
if (!AccessInfo.MemoryObject->getName().startswith(
463+
if (!AccessInfo.MemoryObject->getName().starts_with(
464464
"JUMP_TABLE/" + Function.getOneName().str()))
465465
return JumpTableInfoType();
466466
Index =

bolt/lib/Passes/ReorderData.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,14 +408,14 @@ bool ReorderData::markUnmoveableSymbols(BinaryContext &BC,
408408
// suffix in another.
409409
auto isPrivate = [&](const BinaryData *BD) {
410410
auto Prefix = std::string("PG") + BC.AsmInfo->getPrivateGlobalPrefix();
411-
return BD->getName().startswith(Prefix.str());
411+
return BD->getName().starts_with(Prefix.str());
412412
};
413413
auto Range = BC.getBinaryDataForSection(Section);
414414
bool FoundUnmoveable = false;
415415
for (auto Itr = Range.begin(); Itr != Range.end(); ++Itr) {
416416
BinaryData *Next =
417417
std::next(Itr) != Range.end() ? std::next(Itr)->second : nullptr;
418-
if (Itr->second->getName().startswith("PG.")) {
418+
if (Itr->second->getName().starts_with("PG.")) {
419419
BinaryData *Prev =
420420
Itr != Range.begin() ? std::prev(Itr)->second : nullptr;
421421
bool PrevIsPrivate = Prev && isPrivate(Prev);

bolt/lib/Passes/ShrinkWrapping.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,12 +1416,12 @@ bool ShrinkWrapping::foldIdenticalSplitEdges() {
14161416
bool Changed = false;
14171417
for (auto Iter = BF.begin(); Iter != BF.end(); ++Iter) {
14181418
BinaryBasicBlock &BB = *Iter;
1419-
if (!BB.getName().startswith(".LSplitEdge"))
1419+
if (!BB.getName().starts_with(".LSplitEdge"))
14201420
continue;
14211421
for (BinaryBasicBlock &RBB : llvm::reverse(BF)) {
14221422
if (&RBB == &BB)
14231423
break;
1424-
if (!RBB.getName().startswith(".LSplitEdge") || !RBB.isValid() ||
1424+
if (!RBB.getName().starts_with(".LSplitEdge") || !RBB.isValid() ||
14251425
!isIdenticalSplitEdgeBB(BC, *Iter, RBB))
14261426
continue;
14271427
assert(RBB.pred_size() == 1 && "Invalid split edge BB");

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,7 @@ DataAggregator::parseMMapEvent() {
19151915
// PERF_RECORD_MMAP2 <pid>/<tid>: [<hexbase>(<hexsize>) .*]: .* <file_name>
19161916

19171917
StringRef FileName = Line.rsplit(FieldSeparator).second;
1918-
if (FileName.startswith("//") || FileName.startswith("[")) {
1918+
if (FileName.starts_with("//") || FileName.starts_with("[")) {
19191919
consumeRestOfLine();
19201920
return std::make_pair(StringRef(), ParsedInfo);
19211921
}
@@ -2168,7 +2168,7 @@ DataAggregator::getFileNameForBuildID(StringRef FileBuildID) {
21682168
continue;
21692169
}
21702170

2171-
if (IDPair->second.startswith(FileBuildID)) {
2171+
if (IDPair->second.starts_with(FileBuildID)) {
21722172
FileName = sys::path::filename(IDPair->first);
21732173
break;
21742174
}

bolt/lib/Profile/DataReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ bool hasVolatileName(const BinaryFunction &BF) {
5555
/// Return standard escaped name of the function possibly renamed by BOLT.
5656
std::string normalizeName(StringRef NameRef) {
5757
// Strip "PG." prefix used for globalized locals.
58-
NameRef = NameRef.startswith("PG.") ? NameRef.substr(2) : NameRef;
58+
NameRef = NameRef.starts_with("PG.") ? NameRef.substr(2) : NameRef;
5959
return getEscapedName(NameRef);
6060
}
6161

0 commit comments

Comments
 (0)