Skip to content

Commit d5d25bd

Browse files
authored
Merge pull request #31 from Xilinx/ferdinand.llvm_bump_april_23
Ferdinand.llvm bump may 0305
2 parents 5eadf27 + b311c1b commit d5d25bd

File tree

6,184 files changed

+273734
-99689
lines changed

Some content is hidden

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

6,184 files changed

+273734
-99689
lines changed

.github/workflows/llvm-project-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
with:
6767
fetch-depth: 250
6868
- name: Setup ccache
69-
uses: hendrikmuhs/ccache-action@v1.2
69+
uses: hendrikmuhs/ccache-action@v1
7070
with:
7171
# A full build of llvm, clang, lld, and lldb takes about 250MB
7272
# of ccache space. There's not much reason to have more than this,
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Release Binaries
2+
3+
on:
4+
push:
5+
tags:
6+
- 'llvmorg-*'
7+
workflow_dispatch:
8+
inputs:
9+
upload:
10+
description: 'Upload binaries to the release page'
11+
required: true
12+
default: true
13+
type: boolean
14+
tag:
15+
description: 'Tag to build'
16+
required: true
17+
type: string
18+
19+
permissions:
20+
contents: read # Default everything to read-only
21+
22+
jobs:
23+
prepare:
24+
name: Prepare to build binaries
25+
runs-on: ubuntu-22.04
26+
if: github.repository == 'llvm/llvm-project'
27+
outputs:
28+
release-version: ${{ steps.validate-tag.outputs.release-version }}
29+
release: ${{ steps.validate-tag.outputs.release }}
30+
build-dir: ${{ steps.validate-tag.outputs.build-dir }}
31+
rc-flags: ${{ steps.validate-tag.outputs.rc-flags }}
32+
ref: ${{ steps.validate-tag.outputs.ref }}
33+
34+
steps:
35+
- name: Checkout LLVM
36+
uses: actions/checkout@v3
37+
38+
- name: Validate and parse tag
39+
id: validate-tag
40+
# In order for the test-release.sh script to run correctly, the LLVM
41+
# source needs to be at the following location relative to the build dir:
42+
# | X.Y.Z-rcN | ./rcN/llvm-project
43+
# | X.Y.Z | ./final/llvm-project
44+
#
45+
# We also need to set divergent flags based on the release version:
46+
# | X.Y.Z-rcN | -rc N -test-asserts
47+
# | X.Y.Z | -final
48+
run: |
49+
tag="${{ github.ref_name }}"
50+
trimmed=`echo ${{ inputs.tag }} | xargs`
51+
[[ "$trimmed" != "" ]] && tag="$trimmed"
52+
if [ -n "${{ inputs.upload }}" ]; then
53+
upload="${{ inputs.upload }}"
54+
else
55+
upload="true"
56+
fi
57+
bash .github/workflows/set-release-binary-outputs.sh "${{ github.actor }}" "$tag" "$upload"
58+
59+
build-binaries:
60+
name: ${{ matrix.target.triple }}
61+
permissions:
62+
contents: write # To upload assets to release.
63+
needs: prepare
64+
runs-on: ${{ matrix.target.runs-on }}
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
target:
69+
- triple: x86_64-linux-gnu-ubuntu-22.04
70+
runs-on: ubuntu-22.04-8x32
71+
debian-build-deps: >
72+
chrpath
73+
gcc-multilib
74+
ninja-build
75+
76+
steps:
77+
- name: Checkout LLVM
78+
uses: actions/checkout@v3
79+
with:
80+
ref: ${{ needs.prepare.outputs.ref }}
81+
path: ${{ needs.prepare.outputs.build-dir }}/llvm-project
82+
83+
- name: Install Brew build dependencies
84+
if: matrix.target.brew-build-deps != ''
85+
run: brew install ${{ matrix.target.brew-build-deps }}
86+
87+
- name: Install Debian build dependencies
88+
if: matrix.target.debian-build-deps != ''
89+
run: sudo apt install ${{ matrix.target.debian-build-deps }}
90+
91+
- name: Set macOS build env variables
92+
if: runner.os == 'macOS'
93+
run: |
94+
echo "MACOSX_DEPLOYMENT_TARGET=10.9" >> $GITHUB_ENV
95+
96+
- name: Build and test release
97+
run: |
98+
${{ needs.prepare.outputs.build-dir }}/llvm-project/llvm/utils/release/test-release.sh \
99+
-release ${{ needs.prepare.outputs.release }} \
100+
${{ needs.prepare.outputs.rc-flags }} \
101+
-triple ${{ matrix.target.triple }} \
102+
-use-ninja \
103+
-no-checkout \
104+
-no-test-suite
105+
106+
- name: Upload binaries
107+
if: ${{ always() && needs.prepare.outputs.upload == 'true' }}
108+
run: |
109+
${{ needs.prepare.outputs.build-dir }}/llvm-project/llvm/utils/release/github-upload-release.py \
110+
--token ${{ github.token }} \
111+
--release ${{ needs.prepare.outputs.release-version }} \
112+
upload \
113+
--files ${{ needs.prepare.outputs.build-dir }}/clang+llvm-${{ needs.prepare.outputs.release-version }}-${{ matrix.target.triple }}.tar.xz

.github/workflows/release-tasks.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,15 @@ jobs:
4545
4646
- name: Build Documentation
4747
run: |
48-
./llvm/utils/release/build-docs.sh -srcdir llvm
48+
./llvm/utils/release/build-docs.sh -release ${{ steps.validate-tag.outputs.release-version }}
4949
./llvm/utils/release/github-upload-release.py --token ${{ github.token }} --release ${{ steps.validate-tag.outputs.release-version }} upload --files *doxygen*.tar.xz
5050
51+
- name: Create Release Notes Artifact
52+
uses: actions/download-artifact@v3
53+
with:
54+
name: release-notes
55+
path: docs-build/html-export/
56+
5157
- name: Clone www-releases
5258
if: ${{ !contains(steps.validate-tag.outputs.release-version, 'rc') }}
5359
uses: actions/checkout@v3
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Usage: set-release-binary-outputs.sh <github_user> <tag> <upload>
2+
3+
set -e
4+
5+
if [ -z "$GITHUB_OUTPUT" ]; then
6+
export GITHUB_OUTPUT=`mktemp`
7+
echo "Warning: Environment variable GITHUB_OUTPUT is not set."
8+
echo "Writing output variables to $GITHUB_OUTPUT"
9+
fi
10+
11+
github_user=$1
12+
tag=$2
13+
upload=$3
14+
15+
if [[ "$github_user" != "tstellar" && "$github_user" != "tru" ]]; then
16+
echo "ERROR: User not allowed: $github_user"
17+
exit 1
18+
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
24+
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,--,-,'`
29+
echo "release-version=$release_version" >> $GITHUB_OUTPUT
30+
echo "release=$release" >> $GITHUB_OUTPUT
31+
echo "build-dir=$build_dir" >> $GITHUB_OUTPUT
32+
echo "rc-flags=$rc_flags" >> $GITHUB_OUTPUT
33+
echo "upload=$upload" >> $GITHUB_OUTPUT
34+
echo "ref=$tag" >> $GITHUB_OUTPUT

.mailmap

Lines changed: 1 addition & 0 deletions

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ To get started with contributing, please take a look at the
77
[Contributing to LLVM](https://llvm.org/docs/Contributing.html) guide. It
88
describes how to get involved, raise issues and submit patches. Please note
99
that at the moment the LLVM project does not use GitHub pull requests.
10+
11+
## Getting in touch
12+
13+
Join the [LLVM Discourse forums](https://discourse.llvm.org/), [Discord
14+
chat](https://discord.gg/xS7Z362), or #llvm IRC channel on
15+
[OFTC](https://oftc.net/).
16+
17+
The LLVM project has adopted a [code of conduct](https://llvm.org/docs/CodeOfConduct.html) for
18+
participants to all modes of communication within the project.

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,8 +1227,7 @@ class BinaryContext {
12271227
Emitter = this->MCE.get();
12281228
SmallString<256> Code;
12291229
SmallVector<MCFixup, 4> Fixups;
1230-
raw_svector_ostream VecOS(Code);
1231-
Emitter->encodeInstruction(Inst, VecOS, Fixups, *STI);
1230+
Emitter->encodeInstruction(Inst, Code, Fixups, *STI);
12321231
return Code.size();
12331232
}
12341233

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,6 +1794,10 @@ class BinaryFunction {
17941794
/// executions corresponding to this function.
17951795
uint64_t getRawBranchCount() const { return RawBranchCount; }
17961796

1797+
/// Set the profile data about the number of branch executions corresponding
1798+
/// to this function.
1799+
void setRawBranchCount(uint64_t Count) { RawBranchCount = Count; }
1800+
17971801
/// Return the execution count for functions with known profile.
17981802
/// Return 0 if the function has no profile.
17991803
uint64_t getKnownExecutionCount() const {

bolt/lib/Core/BinaryContext.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,9 +2289,8 @@ bool BinaryContext::validateInstructionEncoding(
22892289

22902290
SmallString<256> Code;
22912291
SmallVector<MCFixup, 4> Fixups;
2292-
raw_svector_ostream VecOS(Code);
22932292

2294-
MCE->encodeInstruction(Inst, VecOS, Fixups, *STI);
2293+
MCE->encodeInstruction(Inst, Code, Fixups, *STI);
22952294
auto OutputSequence = ArrayRef<uint8_t>((uint8_t *)Code.data(), Code.size());
22962295
if (InputSequence != OutputSequence) {
22972296
if (opts::Verbosity > 1) {

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ void BinaryFunction::print(raw_ostream &OS, std::string Annotation) {
470470
OS << "\n Image : 0x" << Twine::utohexstr(getImageAddress());
471471
if (ExecutionCount != COUNT_NO_PROFILE) {
472472
OS << "\n Exec Count : " << ExecutionCount;
473+
OS << "\n Branch Count: " << RawBranchCount;
473474
OS << "\n Profile Acc : " << format("%.1f%%", ProfileMatchRatio * 100.0f);
474475
}
475476

@@ -1535,8 +1536,7 @@ bool BinaryFunction::scanExternalRefs() {
15351536
// Emit the instruction using temp emitter and generate relocations.
15361537
SmallString<256> Code;
15371538
SmallVector<MCFixup, 4> Fixups;
1538-
raw_svector_ostream VecOS(Code);
1539-
Emitter.MCE->encodeInstruction(Instruction, VecOS, Fixups, *BC.STI);
1539+
Emitter.MCE->encodeInstruction(Instruction, Code, Fixups, *BC.STI);
15401540

15411541
// Create relocation for every fixup.
15421542
for (const MCFixup &Fixup : Fixups) {
@@ -2038,6 +2038,7 @@ bool BinaryFunction::buildCFG(MCPlusBuilder::AllocatorIdTy AllocatorId) {
20382038
MCInst *PrevInstr = PrevBB->getLastNonPseudoInstr();
20392039
assert(PrevInstr && "no previous instruction for a fall through");
20402040
if (MIB->isUnconditionalBranch(Instr) &&
2041+
!MIB->isIndirectBranch(*PrevInstr) &&
20412042
!MIB->isUnconditionalBranch(*PrevInstr) &&
20422043
!MIB->getConditionalTailCall(*PrevInstr) &&
20432044
!MIB->isReturn(*PrevInstr)) {

bolt/lib/Core/DebugData.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ void DebugStrOffsetsWriter::initialize(
11661166
"Dwarf String Offsets Byte Size is not supported.");
11671167
uint32_t Index = 0;
11681168
for (uint64_t Offset = 0; Offset < Contr->Size; Offset += DwarfOffsetByteSize)
1169-
IndexToAddressMap[Index++] = *reinterpret_cast<const uint32_t *>(
1169+
IndexToAddressMap[Index++] = support::endian::read32le(
11701170
StrOffsetsSection.Data.data() + Contr->Base + Offset);
11711171
}
11721172

bolt/lib/Profile/YAMLProfileReader.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ bool YAMLProfileReader::parseFunctionProfile(
8383

8484
BF.setExecutionCount(YamlBF.ExecCount);
8585

86+
uint64_t FuncRawBranchCount = 0;
87+
for (const yaml::bolt::BinaryBasicBlockProfile &YamlBB : YamlBF.Blocks)
88+
for (const yaml::bolt::SuccessorInfo &YamlSI : YamlBB.Successors)
89+
FuncRawBranchCount += YamlSI.Count;
90+
BF.setRawBranchCount(FuncRawBranchCount);
91+
8692
if (!opts::IgnoreHash && YamlBF.Hash != BF.computeHash(/*UseDFS=*/true)) {
8793
if (opts::Verbosity >= 1)
8894
errs() << "BOLT-WARNING: function hash mismatch\n";

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4097,7 +4097,6 @@ void RewriteInstance::mapCodeSections(RuntimeDyld &RTDyld) {
40974097
FF.setImageAddress(0);
40984098
FF.setImageSize(0);
40994099
FF.setFileOffset(0);
4100-
BC->deregisterSection(*ColdSection);
41014100
} else {
41024101
FF.setAddress(NextAvailableAddress);
41034102
FF.setImageAddress(ColdSection->getAllocAddress());
@@ -4112,6 +4111,9 @@ void RewriteInstance::mapCodeSections(RuntimeDyld &RTDyld) {
41124111
FF.getImageAddress(), FF.getAddress(), FF.getImageSize()));
41134112
RTDyld.reassignSectionAddress(ColdSection->getSectionID(), FF.getAddress());
41144113

4114+
if (TooLarge)
4115+
BC->deregisterSection(*ColdSection);
4116+
41154117
NextAvailableAddress += FF.getImageSize();
41164118
}
41174119

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
265265
return true;
266266
}
267267

268-
DispImm = Inst.getOperand(I).getImm() << 2;
268+
DispImm = Inst.getOperand(I).getImm() * 4;
269269
return true;
270270
}
271271
return false;

bolt/test/X86/branch-data.test

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
# Also checks that llvm-bolt disassembler and CFG builder is working properly.
44

55
RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
6-
RUN: llvm-bolt %t.exe -o /dev/null --data %p/Inputs/blarge.fdata --print-cfg
6+
RUN: llvm-bolt %t.exe -o /dev/null --data %p/Inputs/blarge.fdata --print-cfg | FileCheck %s
77

88
CHECK: Binary Function "usqrt"
99
CHECK: State : CFG constructed
1010
CHECK: Address : 0x401170
1111
CHECK: Size : 0x43
12-
CHECK: MaxSize : 0x50
13-
CHECK: Offset : 0x1170
12+
CHECK: MaxSize : 0x43
13+
CHECK: Offset : 0xcb0
1414
CHECK: Section : .text
1515
CHECK: IsSimple : 1
1616
CHECK: BB Count : 5
1717
CHECK: Exec Count : 199
18+
CHECK: Branch Count: 7689
1819
CHECK: }
1920
CHECK: .LBB{{.*}}
2021
CHECK: Exec Count : 199

bolt/test/X86/section-end-sym.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Check that BOLT doesn't consider end-of-section symbols (e.g., _etext) as
22
## functions.
33

4-
# REQUIRES: system-linux, asserts
4+
# REQUIRES: x86_64-linux, asserts
55

66
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o
77
# RUN: ld.lld %t.o -o %t.exe -q

0 commit comments

Comments
 (0)