Skip to content

Commit 4549649

Browse files
committed
Merge branch 'main' into dwarf-pauth-llvm-dinodes
2 parents 0d17f23 + 13bb726 commit 4549649

File tree

4,921 files changed

+232947
-95558
lines changed

Some content is hidden

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

4,921 files changed

+232947
-95558
lines changed

.arcconfig

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

.arclint

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

.ci/generate-buildkite-pipeline-premerge

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,7 @@ linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq)
233233

234234
windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects}))
235235
windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq)
236-
# Temporary disable the windows job.
237-
# See https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840
238-
#windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq)
239-
windows_projects=""
236+
windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq)
240237

241238
# Generate the appropriate pipeline
242239
if [[ "${linux_projects}" != "" ]]; then

.ci/monolithic-windows.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ targets="${2}"
3838

3939
echo "--- cmake"
4040
pip install -q -r ${MONOREPO_ROOT}/mlir/python/requirements.txt
41+
42+
# The CMAKE_*_LINKER_FLAGS to disable the manifest come from research
43+
# on fixing a build reliability issue on the build server, please
44+
# see https://github.com/llvm/llvm-project/pull/82393 and
45+
# https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840/40
46+
# for further information.
4147
cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
4248
-D LLVM_ENABLE_PROJECTS="${projects}" \
4349
-G Ninja \
@@ -49,7 +55,10 @@ cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
4955
-D COMPILER_RT_BUILD_ORC=OFF \
5056
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
5157
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
52-
-D MLIR_ENABLE_BINDINGS_PYTHON=ON
58+
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
59+
-D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
60+
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
61+
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO"
5362

5463
echo "--- ninja"
5564
# Targets are not escaped as they are passed as separate arguments.

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Checks: '-*,clang-diagnostic-*,llvm-*,misc-*,-misc-const-correctness,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-misc-no-recursion,-misc-use-anonymous-namespace,readability-identifier-naming'
1+
Checks: '-*,clang-diagnostic-*,llvm-*,misc-*,-misc-const-correctness,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-misc-no-recursion,-misc-use-anonymous-namespace,readability-identifier-naming,-misc-include-cleaner'
22
CheckOptions:
33
- key: readability-identifier-naming.ClassCase
44
value: CamelCase

.github/new-prs-labeler.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,9 +846,32 @@ backend:PowerPC:
846846
- clang/lib/Driver/ToolChains/Arch/PPC.*
847847
- clang/test/CodeGen/PowerPC/**
848848

849+
backend:SystemZ:
850+
- llvm/include/llvm/BinaryFormat/ELFRelocs/SystemZ*
851+
- llvm/include/llvm/BinaryFormat/GOFF.h
852+
- llvm/include/llvm/IR/IntrinsicsSystemZ.td
853+
- llvm/lib/Target/SystemZ/**
854+
- llvm/test/Analysis/**/SystemZ/**
855+
- llvm/test/CodeGen/SystemZ/**
856+
- llvm/test/DebugInfo/SystemZ/**
857+
- llvm/test/ExecutionEngine/**/SystemZ/**
858+
- llvm/test/MC/Disassembler/SystemZ/**
859+
- llvm/test/MC/GOFF/**
860+
- llvm/test/MC/SystemZ/**
861+
- llvm/test/Transforms/**/SystemZ/**
862+
- clang/include/clang/Basic/BuiltinsSystemZ.*
863+
- clang/lib/Basic/Targets/SystemZ.*
864+
- clang/lib/CodeGen/Targets/SystemZ.cpp
865+
- clang/lib/Driver/ToolChains/ZOS*
866+
- clang/lib/Driver/ToolChains/Arch/SystemZ.*
867+
- clang/test/CodeGen/SystemZ/**
868+
849869
third-party:unittests:
850870
- third-party/unittests/**
851871

872+
third-party:benchmark:
873+
- third-party/benchmark/**
874+
852875
llvm:binary-utilities:
853876
- llvm/docs/CommandGuide/llvm-*
854877
- llvm/include/llvm/BinaryFormat/**

.github/workflows/build-ci-container.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,18 @@ jobs:
7777
cp ./.github/workflows/containers/github-action-ci/storage.conf ~/.config/containers/storage.conf
7878
podman info
7979
80+
# Download the container image into /mnt/podman rather than
81+
# $GITHUB_WORKSPACE to avoid space limitations on the default drive
82+
# and use the permissions setup for /mnt/podman.
8083
- name: Download stage1-toolchain
8184
uses: actions/download-artifact@v4
8285
with:
8386
name: stage1-toolchain
87+
path: /mnt/podman
8488

8589
- name: Load stage1-toolchain
8690
run: |
87-
podman load -i stage1-toolchain.tar
91+
podman load -i /mnt/podman/stage1-toolchain.tar
8892
8993
- name: Build Container
9094
working-directory: ./.github/workflows/containers/github-action-ci/

.github/workflows/containers/github-action-ci/stage2.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ COPY --from=stage2-toolchain $LLVM_SYSROOT $LLVM_SYSROOT
1212
# Need to install curl for hendrikmuhs/ccache-action
1313
# Need nodejs for some of the GitHub actions.
1414
# Need perl-modules for clang analyzer tests.
15+
# Need git for SPIRV-Tools tests.
1516
RUN apt-get update && \
1617
apt-get install -y \
1718
binutils \
1819
cmake \
1920
curl \
21+
git \
2022
libstdc++-11-dev \
2123
ninja-build \
2224
nodejs \

.github/workflows/release-tasks.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
name: Create a New Release
2929
runs-on: ubuntu-latest
3030
needs: validate-tag
31+
3132
steps:
3233
- name: Install Dependencies
3334
run: |
@@ -40,8 +41,9 @@ jobs:
4041
- name: Create Release
4142
env:
4243
GITHUB_TOKEN: ${{ github.token }}
44+
USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
4345
run: |
44-
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --release ${{ needs.validate-tag.outputs.release-version }} --user ${{ github.actor }} create
46+
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --release ${{ needs.validate-tag.outputs.release-version }} --user ${{ github.actor }} --user-token "$USER_TOKEN" create
4547
release-documentation:
4648
name: Build and Upload Release Documentation
4749
needs:

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,10 @@ class BinaryContext {
997997
return getUniqueSectionByName(".gdb_index");
998998
}
999999

1000+
ErrorOr<BinarySection &> getDebugNamesSection() const {
1001+
return getUniqueSectionByName(".debug_names");
1002+
}
1003+
10001004
/// @}
10011005

10021006
/// Register \p TargetFunction as a fragment of \p Function if checks pass:

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,6 +2056,14 @@ class BinaryFunction {
20562056
/// Returns false if disassembly failed.
20572057
Error disassemble();
20582058

2059+
/// An external interface to register a branch while the function is in
2060+
/// disassembled state. Allows to make custom modifications to the
2061+
/// disassembler. E.g., a pre-CFG pass can add an instruction and register
2062+
/// a branch that will later be used during the CFG construction.
2063+
///
2064+
/// Return a label at the branch destination.
2065+
MCSymbol *registerBranch(uint64_t Src, uint64_t Dst);
2066+
20592067
Error handlePCRelOperand(MCInst &Instruction, uint64_t Address,
20602068
uint64_t Size);
20612069

bolt/include/bolt/Core/BinarySection.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,7 @@ class BinarySection {
139139
Alignment = NewAlignment;
140140
ELFType = NewELFType;
141141
ELFFlags = NewELFFlags;
142-
OutputSize = NewSize;
143-
OutputContents = StringRef(reinterpret_cast<const char *>(NewData),
144-
NewData ? NewSize : 0);
145-
IsFinalized = true;
142+
updateContents(NewData, NewSize);
146143
}
147144

148145
public:
@@ -484,9 +481,18 @@ class BinarySection {
484481
void flushPendingRelocations(raw_pwrite_stream &OS,
485482
SymbolResolverFuncTy Resolver);
486483

487-
/// Change contents of the section.
488-
void updateContents(const uint8_t *Data, size_t NewSize) {
489-
OutputContents = StringRef(reinterpret_cast<const char *>(Data), NewSize);
484+
/// Change contents of the section. Unless the section has a valid SectionID,
485+
/// the memory passed in \p NewData will be managed by the instance of
486+
/// BinarySection.
487+
void updateContents(const uint8_t *NewData, size_t NewSize) {
488+
if (getOutputData() && !hasValidSectionID() &&
489+
(!hasSectionRef() ||
490+
OutputContents.data() != getContentsOrQuit(Section).data())) {
491+
delete[] getOutputData();
492+
}
493+
494+
OutputContents = StringRef(reinterpret_cast<const char *>(NewData),
495+
NewData ? NewSize : 0);
490496
OutputSize = NewSize;
491497
IsFinalized = true;
492498
}

bolt/include/bolt/Core/DIEBuilder.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define BOLT_CORE_DIE_BUILDER_H
1717

1818
#include "bolt/Core/BinaryContext.h"
19+
#include "bolt/Core/DebugNames.h"
1920
#include "llvm/CodeGen/DIE.h"
2021
#include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
2122
#include "llvm/DebugInfo/DWARF/DWARFDie.h"
@@ -124,9 +125,10 @@ class DIEBuilder {
124125
std::vector<std::unique_ptr<DIEAbbrev>> Abbreviations;
125126
BinaryContext &BC;
126127
DWARFContext *DwarfContext{nullptr};
127-
bool IsDWO{false};
128+
DWARFUnit *SkeletonCU{nullptr};
128129
uint64_t UnitSize{0};
129130
llvm::DenseSet<uint64_t> AllProcessed;
131+
DWARF5AcceleratorTable &DebugNamesTable;
130132

131133
/// Returns current state of the DIEBuilder
132134
State &getState() { return *BuilderState.get(); }
@@ -206,8 +208,8 @@ class DIEBuilder {
206208
/// Update references once the layout is finalized.
207209
void updateReferences();
208210

209-
/// Update the Offset and Size of DIE.
210-
uint32_t computeDIEOffset(const DWARFUnit &CU, DIE &Die, uint32_t &CurOffset);
211+
/// Update the Offset and Size of DIE, populate DebugNames table.
212+
uint32_t finalizeDIEs(DWARFUnit &CU, DIE &Die, uint32_t &CurOffset);
211213

212214
void registerUnit(DWARFUnit &DU, bool NeedSort);
213215

@@ -264,8 +266,13 @@ class DIEBuilder {
264266
/// current Section.
265267
DIE *constructDIEFast(DWARFDie &DDie, DWARFUnit &U, uint32_t UnitId);
266268

269+
/// Returns true if this DIEBUilder is for DWO Unit.
270+
bool isDWO() const { return SkeletonCU != nullptr; }
271+
267272
public:
268-
DIEBuilder(BinaryContext &BC, DWARFContext *DwarfContext, bool IsDWO = false);
273+
DIEBuilder(BinaryContext &BC, DWARFContext *DwarfContext,
274+
DWARF5AcceleratorTable &DebugNamesTable,
275+
DWARFUnit *SkeletonCU = nullptr);
269276

270277
/// Returns enum to what we are currently processing.
271278
ProcessingType getCurrentProcessingState() { return getState().Type; }

bolt/include/bolt/Core/DebugData.h

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,8 @@ class DebugStrOffsetsWriter {
439439
/// Update Str offset in .debug_str in .debug_str_offsets.
440440
void updateAddressMap(uint32_t Index, uint32_t Address);
441441

442+
/// Get offset for given index in original .debug_str_offsets section.
443+
uint64_t getOffset(uint32_t Index) const { return StrOffsets[Index]; }
442444
/// Writes out current sections entry into .debug_str_offsets.
443445
void finalizeSection(DWARFUnit &Unit, DIEBuilder &DIEBldr);
444446

@@ -450,14 +452,20 @@ class DebugStrOffsetsWriter {
450452
return std::move(StrOffsetsBuffer);
451453
}
452454

453-
private:
454455
/// Initializes Buffer and Stream.
455456
void initialize(DWARFUnit &Unit);
456457

458+
/// Clear data.
459+
void clear() {
460+
IndexToAddressMap.clear();
461+
StrOffsets.clear();
462+
}
463+
464+
private:
457465
std::unique_ptr<DebugStrOffsetsBufferVector> StrOffsetsBuffer;
458466
std::unique_ptr<raw_svector_ostream> StrOffsetsStream;
459467
std::map<uint32_t, uint32_t> IndexToAddressMap;
460-
std::vector<uint32_t> StrOffsets;
468+
SmallVector<uint32_t, 5> StrOffsets;
461469
std::unordered_map<uint64_t, uint64_t> ProcessedBaseOffsets;
462470
bool StrOffsetSectionWasModified = false;
463471
};
@@ -478,11 +486,12 @@ class DebugStrWriter {
478486
/// Returns False if no strings were added to .debug_str.
479487
bool isInitialized() const { return !StrBuffer->empty(); }
480488

489+
/// Initializes Buffer and Stream.
490+
void initialize();
491+
481492
private:
482493
/// Mutex used for parallel processing of debug info.
483494
std::mutex WriterMutex;
484-
/// Initializes Buffer and Stream.
485-
void initialize();
486495
/// Creates internal data structures.
487496
void create();
488497
std::unique_ptr<DebugStrBufferVector> StrBuffer;

0 commit comments

Comments
 (0)