Skip to content

[AutoBump] Merge with 258a5d49 (Nov 20) (11) #473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 367 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
367 commits
Select commit Hold shift + click to select a range
61726ad
[AArch64] Update predicate for FEXPA (#116613)
Lukacma Nov 19, 2024
6f53ae6
[X86] Properly chain PROBED_ALLOCA / SEG_ALLOCA (#116508)
s-barannikov Nov 19, 2024
95ab426
[X86] Attempt to canonicalize vXf64 SHUFPD shuffle masks with undef e…
RKSimon Nov 19, 2024
843498d
[LLD][AArch64] Add test for missing AArch64 BTI thunk (#116665)
smithp35 Nov 19, 2024
7dcefb3
[X86] Tidyup up AVX512 FPCLASS instruction naming (#116661)
RKSimon Nov 19, 2024
129a1a2
[amdgpu-arch] Replace use of HSA with reading sysfs directly (#116651)
jhuber6 Nov 19, 2024
cac6f21
[LoopInterchange] Make the entries of the Dependency Matrix unique (#…
sjoerdmeijer Nov 19, 2024
8a6a76b
[clangd] Let DefineOutline tweak handle member function templates (#1…
ckandeler Nov 19, 2024
b24acc0
[Flang][LoongArch] Add sign extension for i32 arguments and returns i…
ylzsx Nov 19, 2024
a59976b
[InstCombine] Drop noundef attributes in `foldCttzCtlz` (#116718)
dtcxzyw Nov 19, 2024
42ed775
[InstSimplify] Generalize `simplifyAndOrOfFCmps` to handle fabs (#116…
dtcxzyw Nov 19, 2024
55fad5e
[amdgpu-arch] Fix unused StringRef result
jhuber6 Nov 19, 2024
1218071
[NFC][LoopVectorize] Introduce new getEstimatedRuntimeVF function (#1…
david-arm Nov 19, 2024
c4030c8
[RISCV] Fix FP64 DinX R Regclass (#116688)
lenary Nov 19, 2024
b03a747
[clang] constexpr built-in reduce mul function. (#116626)
c8ef Nov 19, 2024
2153672
[MLIR] Add callback functions for ModuleToObject (#116007)
MikaOvO Nov 19, 2024
01a1ca7
[libc++][NFC] Format a pait test
philnik777 Nov 19, 2024
4f0403f
[CodeGen][AArch64] Sink splat operands of FMul instructions (#116222)
hazzlim Nov 19, 2024
75a04c6
[LoongArch][NFC] Fix the operand constraint of AMCAS instructions (#1…
xen0n Nov 19, 2024
9e0ea8c
[InstCombine] Add extra test for preserving !llvm.access.group
fhahn Nov 19, 2024
c727b48
[SDAG][ISel][TableGen][LoongArch] Report error for trivial bitcasts w…
dtcxzyw Nov 19, 2024
681939e
[LAA] Add phi test variant for cross-iteration dependence (NFC)
nikic Nov 19, 2024
4728ac7
[LLD][COFF][NFC] Always align null chunks (#116677)
cjacek Nov 19, 2024
ee4fb3a
[llvm][docs] Correct setence in How To Add A Builder
DavidSpickett Nov 19, 2024
a874406
[clang-repl] Include consistency using the default clang actions. (#1…
vgvassilev Nov 19, 2024
edf56f1
[LoopInterchange] Don't rely on ASSERTS build for tests. NFC. (#116780)
sjoerdmeijer Nov 19, 2024
f69646e
[XCore] Pattern match LADD/LSUB/LMUL/MACCU/MACCS/CRC8 (#116245)
s-barannikov Nov 19, 2024
bdf00e2
[mlir][spirv] Use assemblyFormat to define AccessChainOp assembly (#1…
cydonialis Nov 19, 2024
03d8831
[InstCombine] Handle constant GEP expr in `SimplifyDemandedUseBits` (…
dtcxzyw Nov 19, 2024
abac5be
[InstCombine] Fix APInt ctor assertion
nikic Nov 19, 2024
26a89d2
[InstCombine] Make access.group metadata tags distinct in test.
fhahn Nov 19, 2024
af41c55
Revert "[MLIR] Add callback functions for ModuleToObject" (#116811)
joker-eph Nov 19, 2024
27dcae5
[lldb] Convert file address to load address when reading memory for D…
kuilpd Nov 19, 2024
aff98e4
[ARM] Stop gluing 1-bit shifts (#116547)
s-barannikov Nov 19, 2024
8e4423e
[AsmPrinter] Fix handling in emitGlobalConstantImpl for AIX (#116255)
syzaara Nov 19, 2024
b0afa6b
[clang] Change some placeholders from undef to poison [NFC]
nunoplopes Nov 19, 2024
64e3466
[lld][Hexagon] Fix R_HEX_B22_PCREL range checks (#115925)
quic-akaryaki Nov 19, 2024
de6d168
Revert "[lldb] Convert file address to load address when reading memo…
kuilpd Nov 19, 2024
21fc36b
Revert "[FunctionAttrs] Add the "initializes" attribute inference" (#…
haopliu Nov 19, 2024
b3995aa
[AMDGPU] Decrease default NSA threshold from 3 to 2 (#116624)
jayfoad Nov 19, 2024
03506bc
[TextAPI] Add missing attribute to remove/merge/extract operations (#…
cyndyishida Nov 19, 2024
4859195
[Thumb2][ARMAsmParser] Fix processing of `t2{LDR,STR}{*}_{PRE,POST}_i…
bzEq Nov 19, 2024
30fad6a
Thread safety analysis: Implement MutexLocker factory functions in do…
aaronpuchert Nov 19, 2024
0d9dc42
[MLIR] Add SystemZ arg extensions for some tests (#116314)
JonPsson1 Nov 19, 2024
d37554b
[ARM] Specifically delineate between different GPRCS2 positions
pestctrl Nov 17, 2024
1bfcf89
[bazel] port a8744066e9ef252b687c1206ccbd1a6e3ae1c890
metaflow Nov 19, 2024
8b2dff9
[lldb] Fix a positioning bug in diagnostics output (#116711)
adrian-prantl Nov 19, 2024
3e552ed
Add release notes for LLDB inline diagnostics (#116841)
adrian-prantl Nov 19, 2024
6b4f675
[lldb] Improve rendering of inline diagnostics on the same column (#1…
adrian-prantl Nov 19, 2024
0611a66
[ARM] Fix a warning
kazutakahirata Nov 19, 2024
197e012
[libc] Replace usage of GPU helpers with ones from 'gpuintrin.h' (#11…
jhuber6 Nov 19, 2024
c84a99d
[InlineAdvisor] Update documentation for `PluginInlineAdvisorAnalysis…
michele-scandale Nov 19, 2024
def22f4
[libc] Pull last dependencies into rpc_util.h (#116693)
jhuber6 Nov 19, 2024
39e65b8
[llvm-mca][x86] Add AVX512 VMOVNTDQA instruction test coverage
RKSimon Nov 19, 2024
8bdf13b
[ObjC] Name lookup in methods shouldn't allow shadowing types (#116683)
apple-fcloutier Nov 19, 2024
2186a00
[HLSL] Fix placement of `const` for resource operator[] (#116698)
bogner Nov 19, 2024
b28eebf
[RDF] Fix cover check when linking refs to defs (#113888)
yandalur Nov 19, 2024
dd78d7c
[lldb] Improve editline completion formatting (#116456)
JDevlieghere Nov 19, 2024
61057b0
[lldb/www] Garbage collect old videos and add new ones (#116838)
adrian-prantl Nov 19, 2024
68b7ab1
[MLIR] Fully qualify entities in the ::mlir namespace in TilingInterf…
ddubov100 Nov 19, 2024
d8a1c6d
[Clang] update reasoned delete diagnostic kind to use Extension, maki…
a-tarasyuk Nov 19, 2024
79682c4
[SLP]Check if the buildvector root is not a part of the graph before …
alexey-bataev Nov 19, 2024
eff60d8
[RISCV][GISel] Make extended loads and truncating stores with s16 reg…
topperc Nov 19, 2024
ca79e12
[flang][cuda] Handle implicit global in cuf kernel and nested stateme…
clementval Nov 19, 2024
565a9ac
[SPIR-V] Disable Machine Sink pass in SPIR-V Backend (#116060)
VyacheslavLevytskyy Nov 19, 2024
9965532
[BOLT] Overwrite .eh_frame and .gcc_except_table (#116755)
maksfb Nov 19, 2024
5681f75
Fix broken link
adrian-prantl Nov 19, 2024
5b79152
[AArch64] Make sure there is test coverage for ptr phis. NFC
davemgreen Nov 19, 2024
174899f
[lldb] Refactor helper by using iterators and in-place edits (NFC) (#…
adrian-prantl Nov 19, 2024
df13acf
[CudaSPIRV] Add support for optional spir-v attributes (#116589)
alexander-shaposhnikov Nov 19, 2024
27046ba
[mlir][XeGPU] Add a builder for xegpu.create_nd_tdesc op. (#116472)
mshahneo Nov 19, 2024
47ef5c4
[mlir][Bindings] Fix missing return value of functions and incorrect …
annuasd Nov 19, 2024
e3ff649
[lldb] Fix comment in ~Thread (NFC) (#116850)
kastiglione Nov 19, 2024
1073e90
AMDGPU: Clean up more real instruction predicate overrides (#116868)
arsenm Nov 19, 2024
1c1fbf5
[lld][WebAssembly] Fix TLS-relative relocations when linking without …
sbc100 Nov 19, 2024
0765136
[Local] Only intersect llvm.access.group metadata if instr moves. (#1…
fhahn Nov 19, 2024
4d7df40
[flang][cuda] Materialize constant src in memory (#116851)
clementval Nov 19, 2024
41c86ca
[RISCV] Add TT-Ascalon-d8 processor (#115100)
ppenzin Nov 19, 2024
012dd8b
[libcxx] Passthrough the necessary CMake variables to benchmarks (#11…
petrhosek Nov 19, 2024
7c41b5c
[rtsan] Add support for ReportErrorSummary (#116424)
cjappl Nov 19, 2024
3c8818c
[rtsan] Add more file descriptor interceptors - dup*, lseek (#116853)
cjappl Nov 19, 2024
944478d
Introduce symbol versioning for clang-cpp (#116556)
aaronpuchert Nov 19, 2024
3a63407
[libc++] Make __atomic_base into an implementation detail of std::ato…
ldionne Nov 19, 2024
d8bd7f1
[mlir] Support ROCDL::ReadlaneOp (#116593)
knwng Nov 19, 2024
581f755
[gn build] Port 3a6340768631
llvmgnsyncbot Nov 19, 2024
21df325
[mlir,python] Expose replaceAllUsesExcept to Python bindings (#115850)
Wheest Nov 20, 2024
d29a50f
Revert "[lldb] Allow fetching of RA register when above fault handler…
jasonmolenda Nov 19, 2024
e72209d
[MachineSink] Fix stable sort comparator (#116705)
ellishg Nov 20, 2024
73216cd
[flang] Rework CUDA kernel DO host array check (#116301)
klausler Nov 20, 2024
300370c
[flang] Catch I/O statement error (#116647)
klausler Nov 20, 2024
d20f55f
[flang] Silence bogus error on local proc pointer initializer (#116663)
klausler Nov 20, 2024
a54e8b2
[flang] Silence bogus error about insufficiently defined interfaces (…
klausler Nov 20, 2024
6e48214
[SandboxVec][DAG] Register callback for erase instr (#116742)
vporpo Nov 20, 2024
e394fec
[mlir][func] Remove `func-bufferize` pass (#114152)
matthias-springer Nov 20, 2024
066dd91
[BOLT] Offset LPStart to avoid unnecessary instructions (#116713)
maksfb Nov 20, 2024
f981ee7
[MLIR] extend `getCompressedMaskOp` support in `VectorEmulateNarrowTy…
lialan Nov 20, 2024
673b5dd
Revert "Introduce symbol versioning for clang-cpp (#116556)"
rastogishubham Nov 20, 2024
2187738
[RISCV] Add additional CHECK prefixes to fixed-vectors-strided-load-s…
topperc Nov 20, 2024
01cd7ad
[flang][cuda] Do not generate NVVM target attribute when creating the…
clementval Nov 20, 2024
46389eb
[mlir][memref] Fix broken test after #114152 (#116898)
matthias-springer Nov 20, 2024
58280c0
[flang][cuda] Update test after #116882
clementval Nov 20, 2024
04de524
[mlir][arith] Fix build after #114152 (part 2) (#116901)
matthias-springer Nov 20, 2024
1df1998
[mlir][arith] Fix build after #114152 (part 3) (#116903)
matthias-springer Nov 20, 2024
50e38cc
[CMake] Update CMake cache file for the ARM/Aarch64 cross toolchain b…
vvereschaka Nov 20, 2024
40c8938
[flang] Introduce hlfir.elemental lowerings to omp.workshare_loop_nes…
ivanradanov Nov 20, 2024
fa22100
Revert "[flang] Introduce hlfir.elemental lowerings to omp.workshare_…
ivanradanov Nov 20, 2024
461e58e
Introduce symbol versioning for clang-cpp (#116556)
aaronpuchert Nov 19, 2024
8234c61
[LoongArch] Record the special AMO operand constraint with TableGen (…
xen0n Nov 20, 2024
b246d5f
Disable symbol versions for clang-cpp also with MSVC
aaronpuchert Nov 20, 2024
314e9b1
[llvm-profdata] fix typo (#116754)
lifengxiang1025 Nov 20, 2024
a2e266b
[memprof] Add computeUndriftMap (#116478)
kazutakahirata Nov 20, 2024
f97c610
[memprof] Add MemProfReader::takeMemProfData (#116769)
kazutakahirata Nov 20, 2024
1f4d91e
[ExecutionEngine] Remove unused includes (NFC) (#116749)
kazutakahirata Nov 20, 2024
e9c8106
[Object] Remove unused includes (NFC) (#116750)
kazutakahirata Nov 20, 2024
4f1b20f
[ProfileData] Remove unused includes (NFC) (#116751)
kazutakahirata Nov 20, 2024
27d25d1
[libc] Increase RPC opcode to 32-bit and use a class byte (#116905)
jhuber6 Nov 20, 2024
0ff8b79
[clang-format] Stop crashing on slightly off Verilog module headers (…
sstwcw Nov 13, 2024
2bf6751
[RISCV] Add IsRV32 some patterns in RISCVInstrInfoXTHead.td.
topperc Nov 20, 2024
c6bce68
[NFC] [Coroutines] Use std::move to avoid copying (#116776)
abhishek-kaushik22 Nov 20, 2024
fa4d186
[ELF] Move PhdrEntry to SyntheticSections
MaskRay Nov 20, 2024
a520324
[ELF] Avoid make<PhdrEntry>
MaskRay Nov 20, 2024
37e3966
[ELF] Make ThunkCreator take ownership of thunks
MaskRay Nov 20, 2024
1ff22f8
[mlir][vector] Add more tests for ConvertVectorToLLVM (9/n) (#116795)
banach-space Nov 20, 2024
560dd94
[clang] [NFC] In GetDiagForGotoScopeDecl(), limit Init to inside the …
bricknerb Nov 20, 2024
d33673a
[mlir][vector][nfc] Update test for mask elimination (#112130)
banach-space Nov 20, 2024
0394e08
[lldb] Reword the "line 0" warning (#116827)
labath Nov 20, 2024
3a5cf6d
[X86] Rename AVX512 VEXTRACT/INSERT??x? to VEXTRACT/INSERT??X? (#116826)
RKSimon Nov 20, 2024
67a1fdb
[mlir][IR] Treat `tf32` as 19-bit float (#116738)
matthias-springer Nov 20, 2024
1e32a7d
[AA] Rename CaptureInfo -> CaptureAnalysis (NFC) (#116842)
nikic Nov 20, 2024
596bfb8
[MLIR][AMDGPU] Support gpu::ShuffleMode::DOWN lowering in ROCDL (#106…
draganmladjenovic Nov 20, 2024
d49ee7d
[LLVM] Update SelectionDAG maintainers (#116408)
nikic Nov 20, 2024
ac38ab5
[lsan] Use VReport if not REGISTERS_AVAILABLE (#116555)
MaskRay Nov 20, 2024
ddc0c5c
[CMake] Do all availability checks with -D_GNU_SOURCE (#116640)
tambry Nov 20, 2024
aeb88f6
Fix test failures introduced by PR #113697 (#116941)
david-arm Nov 20, 2024
bca846d
[AArch64] Improve mull generation (#114997)
davemgreen Nov 20, 2024
3488113
[NFC] Fixed indentation issue (#116942)
JaydeepChauhan14 Nov 20, 2024
5310855
[clangd] Fix erroneous qualification of template type parameters (#11…
ckandeler Nov 20, 2024
9111d53
[flang] Rename Code Owners to Maintainers (#116009)
DavidSpickett Nov 20, 2024
92604d7
[flang][OpenMP]Add parsing support for MAP(MAPPER(name) ...) (#116274)
Leporacanthicus Nov 20, 2024
b7ddb97
[flang][OpenMP]Add TODO checking for scope allocate and firstprivate …
Leporacanthicus Nov 20, 2024
288f05f
[NFC][MLIR][Linalg] Refactor linalg.matmul tablegen ODS and related C…
shahidact Nov 20, 2024
2b5214b
IR: de-duplicate two CmpInst routines (NFC) (#116866)
artagnon Nov 20, 2024
9bccf61
[AArch64][LV] Set MaxInterleaving to 4 for Neoverse V2 and V3 (#100385)
sjoerdmeijer Nov 20, 2024
09c4124
[AMDGPU] Fix restores in chain functions (#116193)
rovka Nov 20, 2024
9568f88
InstCombine: support floating-point equivalences (#114975)
artagnon Nov 20, 2024
62bf584
[LoongArch][Clang] Make the parameters and return value of {x,}vorn.v…
xry111 Nov 20, 2024
77bf34c
[AArch64][compiler-rt] Add LSE support for Windows. (#116706)
DanielKristofKiss Nov 20, 2024
408659c
[RISCV] Merge GPRPair and GPRF64Pair (#116094)
lenary Nov 20, 2024
1b79225
[AMDGPU] Remove hasPostISelHook for atomics. NFC. (#116791)
jayfoad Nov 20, 2024
5f1a7f2
[X86] Fix scheduler class for EVEX VMOVNTDQA variants and cleanup Sky…
RKSimon Nov 20, 2024
0a1795f
[SDAG] Generalize FSINCOS type legalization (NFC) (#116848)
MacDue Nov 20, 2024
18b02bb
[LICM] allow MemoryAccess creation failure (#116813)
dianqk Nov 20, 2024
af0e0de
[clang] constexpr built-in reduce and function. (#116822)
c8ef Nov 20, 2024
d0522f4
[X86] Fix PSHUFB port usage on Skylake/Icelake
RKSimon Nov 20, 2024
33fcd6a
[NFC][LLVM] Migrate tests to use update_test_checks.py.
paulwalker-arm Nov 20, 2024
08e7609
[mlir][fix] Add callback functions for ModuleToObject (#116916)
MikaOvO Nov 20, 2024
05bcf83
[OpenMP][Build][Wasm][116552] Fixed build problem when compiling with…
maniatic0 Nov 20, 2024
a160e51
[AArch64] Fix SDNode type mismatches between *.td files and ISel (#11…
s-barannikov Nov 20, 2024
1ca853b
[X86][MC,LLD][NFC] Rename R_X86_64_REX2_GOTPCRELX (#116737)
fzou1 Nov 20, 2024
8c56dd3
[ARM] Stop gluing FP comparisons to FMSTAT (#116676)
s-barannikov Nov 20, 2024
2c094ac
[InstCombine] Drop range attributes in `foldBitCeil` (#116641)
dtcxzyw Nov 20, 2024
fe697ef
[Clang] avoid adding consteval condition as the last statement to pre…
a-tarasyuk Nov 20, 2024
f710e4c
Clarify use of contractions in diagnostic messages (#116803)
AaronBallman Nov 20, 2024
ddc2e36
[X86] getSHUFPDImm - allow general shuffle mask size
RKSimon Nov 20, 2024
c0fdedf
[clang-tidy][NFC]remove deps of clang in clang tidy test (#116588)
HerrCai0907 Nov 20, 2024
d0d726e
Fix GCC build problem with 288f05f related to SmallVector. (#116958)
shahidact Nov 20, 2024
b17f607
[SLP][NFC]Remove unnecessary std::optional around Factor value
alexey-bataev Nov 20, 2024
71b87d1
[LLVM][SVE] Ensure all fixed length mask bits are defined. (#116819)
paulwalker-arm Nov 20, 2024
3e15bce
[FuzzMutate] replace undef placeholders with poison
nunoplopes Nov 20, 2024
c22bb6f
[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
usx95 Nov 20, 2024
b49c4af
Fix GCC signed/unsigned comparison warning.
RKSimon Nov 20, 2024
cfd67c2
[flang][OpenMP] Normalize clause modifiers that exist on their own (#…
kparzysz Nov 20, 2024
12cfa41
[bazel] Port for 08e7609692af3cb84da510deac70eeb02cbceb6d
hokein Nov 20, 2024
d44ea71
[Support] Remove unused includes (NFC) (#116752)
kazutakahirata Nov 20, 2024
36ada1b
[Frontend] Remove unused includes (NFC) (#116927)
kazutakahirata Nov 20, 2024
4d6d563
[TargetParser] Remove unused includes (NFC) (#116929)
kazutakahirata Nov 20, 2024
84d853a
[libc] fix scudo integration build (#116979)
SchrodingerZhu Nov 20, 2024
5174d00
[llvm] Add back Allocator.h include to RWMutex.cpp.
fhahn Nov 20, 2024
a9b3ec1
[MachineLICM] Add test case showing load hoisted across memory barrier.
fhahn Nov 20, 2024
c97478c
[LLD][COFF] Emit tail merge pdata for delay load thunks on ARM64EC (#…
cjacek Nov 20, 2024
d2a2236
[libc][NFC] Remove redundant [[convergent]] attributes from RPC
jhuber6 Nov 20, 2024
acc3266
[Clang][NFC] Refactor `Targets.h` to make it publicly accessible (#11…
seven-mile Nov 20, 2024
fce917d
[rtsan] Add pipe, mkfifo interceptors (#116915)
cjappl Nov 20, 2024
a62c549
[SLP][REVEC] The vectorized result for ShuffleVector may not be Shuff…
HanKuanChen Nov 20, 2024
9d5b3c8
[LLVM] Fix Maintainers.md formatting (NFC)
nikic Nov 20, 2024
b8e1d4d
[AMDGPU] prevent shrinking udiv/urem if either operand is in (SignedM…
choikwa Nov 20, 2024
934140a
[rtsan] Remove mkfifoat interceptor (#116997)
cjappl Nov 20, 2024
9fb01fc
[AMDGPU][MC][True16] Support VOP2 instructions with true16 format (#1…
broxigarchen Nov 20, 2024
1b7f690
[LLVM][Maintainers] Add Github account for SundeepKushwaha (NFC)
nikic Nov 20, 2024
5bf017c
[memprof] Use LineLocation in a unit test (NFC) (#116917)
kazutakahirata Nov 20, 2024
f88c913
[memprof] Add a new constructor to MemProfReader (NFC) (#116918)
kazutakahirata Nov 20, 2024
ab7201a
[memprof] Deprecate MemProfReader::getFrameMapping and its friends (N…
kazutakahirata Nov 20, 2024
4acba06
[memprof] Use a new constructor of IndexedAllocationInfo (NFC) (#116920)
kazutakahirata Nov 20, 2024
4b3b74d
[memprof] Use InstrProfWriter::addMemProfData in a unit test (NFC) (#…
kazutakahirata Nov 20, 2024
fb4ecad
[flang][OpenMP] Change clause modifier representation in parser (#116…
kparzysz Nov 20, 2024
e660e65
[lldb] Add an API to derive language-specific runtime information (#1…
adrian-prantl Nov 20, 2024
e2368af
Fix GCC Wparentheses warning in assert condition / message. NFC.
RKSimon Nov 20, 2024
fa9bcb4
[LLVM][Maintainers] Update links to subproject maintainer lists
nikic Nov 20, 2024
ae023f3
[flang] Fix a warning
kazutakahirata Nov 20, 2024
ba7cc95
[Driver] Remove ignored Flag form of -fauto-profile/-fprofile-sample-use
MaskRay Nov 20, 2024
81c2024
[memprof] Remove an unused using directive (#117004)
kazutakahirata Nov 20, 2024
0733f38
[mlir][int-range] Limit xor int range inference to i1 (#116968)
Hardcode84 Nov 20, 2024
81055ff
[mlir][nvvm] Add attributes for cluster dimension PTX directives (#11…
arthurqiu Nov 20, 2024
7404685
[lld-macho] Fix compatibility between --icf=safe_thunks and --keep-ic…
alx32 Nov 20, 2024
8f8dced
Rename GetLanguageInfo to GetLanguageSpecificData (#117012)
adrian-prantl Nov 20, 2024
1f342f9
[RISCV] Add coverage for recently added vectorization intrinsics
preames Nov 20, 2024
6473a36
Make SBFrame::GetLanguageSpecificData() const (#117019)
adrian-prantl Nov 20, 2024
e14827f
[MemProf] Templatize CallStackRadixTreeBuilder (NFC) (#117014)
teresajohnson Nov 20, 2024
2c63e6d
[lldb] Fix double newline typo in PrintCompletion
JDevlieghere Nov 20, 2024
d5032b9
[NFC][Coroutines] Use structured binding with llvm::enumerate in Coro…
TylerNowicki Nov 20, 2024
b170ab2
[memprof] Construct MemProfReader with IndexedMemProfData (#117022)
kazutakahirata Nov 20, 2024
201f4f6
AMDGPU: Add v_mfma_ld_scale_b32 for gfx950 (#116722)
arsenm Nov 20, 2024
c0efcc0
[libc] support fully OOT build (#101287)
SchrodingerZhu Nov 20, 2024
0bb1b68
[Local] Only intersect tbaa metadata if instr moves. (#116682)
fhahn Nov 20, 2024
77ee94e
Add IsText parameter to open yaml file (#116992)
bahareh-farhadi Nov 20, 2024
c0ee8e2
[SandboxVec][SeedCollector] Reject non-simple memory ops for memory s…
Sterling-Augustine Nov 20, 2024
81d93af
[memprof] Fix arm-polly-linux builds
kazutakahirata Nov 20, 2024
86734c8
[NFC][AMDGPU] Remove redundant code in `AMDGPUAsmPrinter.cpp`
shiltian Nov 20, 2024
3282be1
[BOLT] Use ULEB128 encoding for PIE/DSO exception tables (#116911)
maksfb Nov 20, 2024
aee3f5b
[AArch64][SME] Fix naming of FMLA_VG2_M2Z4Z_H -> FMLA_VG2_M2Z2Z_H ins…
aemerson Nov 20, 2024
19f58e3
[AMDGPU][True16][MC] fix a typo in fake16 test (#117033)
broxigarchen Nov 20, 2024
e468653
[memprof] Use LineLocation in a unit test (NFC) (#117031)
kazutakahirata Nov 20, 2024
a3f2e01
[InstCombine] Only fold extract element to trunc if vector `hasOneUse…
peterbell10 Nov 20, 2024
4acf935
Add release note for parallel module creation in LLDB (#116857)
JDevlieghere Nov 20, 2024
4087b87
[RISCV][GISel] Move G_BRJT expansion to legalization (#73711)
topperc Nov 20, 2024
c3207c3
[libc] Use best-fit binary trie to make malloc logarithmic (#106259)
mysterymath Nov 20, 2024
9be475a
Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (…
mysterymath Nov 20, 2024
ec5b729
[memprof] Upgrade a unit test to MemProf Version 3 (#117063)
kazutakahirata Nov 20, 2024
8f53a67
[libc++][Android] Allow testing libc++ with clang-r536225 (#116149)
rprichard Nov 20, 2024
9ebc6f5
[libc++] Include headers in <thread> conditionally (#116539)
philnik777 Nov 20, 2024
1c8ac4c
[libc++][Android] BuildKite CI: update Clang and sysroot versions (#1…
rprichard Nov 20, 2024
f06c187
[lldb][dwarf] Compute fully qualified names on simplified template n…
ZequanWu Nov 20, 2024
a44d60f
Revert "[llvm] Improve llvm.objectsize computation by computing GEP, …
fmayer Nov 20, 2024
c58c226
[AArch64][SME] Fix naming of FMLS_VG4_M4Z2Z_H -> FMLS_VG4_M4Z4Z_H. NFC.
aemerson Nov 20, 2024
07137ce
[CFIFixup] Add frame info to the first block of each section (#113626)
dhoekwater Nov 20, 2024
1466711
[libc] Allow each function can have extra attributes by defining LLVM…
lntue Nov 20, 2024
668f2c7
[clang][UBSan] Make sure that the implicit-conversion group is compat…
Zonotora Nov 20, 2024
ecda140
[flang][cuda] Adapt ExternalNameConversion to work in gpu module (#11…
clementval Nov 20, 2024
f5002a0
[Utils] Extract CollectDebugInfoForCloning from CloneFunctionInto (#1…
artempyanykh Nov 20, 2024
53a6a11
[LLVM][NFC] Use `used`'s element type if available (#116804)
AlexVlx Nov 20, 2024
97e3f62
Revert "[libc] support fully OOT build (#101287)"
jhuber6 Nov 20, 2024
905e831
Revert "[AMDGPU] prevent shrinking udiv/urem if either operand is in …
jhuber6 Nov 21, 2024
c86899d
[clang] Add support for `__declspec(no_init_all)` (#116847)
dpaoliello Nov 21, 2024
fe33bd0
[test] Precommit test for #116936
aeubanks Nov 21, 2024
1de9bc1
[lld][MachO] Respect dylibs linked with `-allowable_client` (#114638)
carlocab Nov 21, 2024
7b5b019
Revert "[X86] Recognize POP/ADD/SUB modifying rsp in getSPAdjust. (#1…
phoebewang Nov 21, 2024
aa65473
[mlir][Transforms][NFC] Dialect conversion: Remove "finalize" phase (…
matthias-springer Nov 21, 2024
4056d93
Revert "[mlir][Transforms][NFC] Dialect conversion: Remove "finalize"…
matthias-springer Nov 21, 2024
258a5d4
[ORC][arm64e] Add PAC signing/stripping support to ExecutorAddr toPtr…
lhames Nov 21, 2024
1d56e9c
[AutoBump] Merge with 258a5d49 (Nov 20)
jorickert Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .github/new-issues-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@

'bolt':
- '/\bbolt(?!\-)\b/i'

'infra:commit-access-request':
- '/Request Commit Access/'
9 changes: 9 additions & 0 deletions bolt/include/bolt/Core/BinarySection.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class BinarySection {
// been renamed)
uint64_t OutputAddress{0}; // Section address for the rewritten binary.
uint64_t OutputSize{0}; // Section size in the rewritten binary.
// Can exceed OutputContents with padding.
uint64_t OutputFileOffset{0}; // File offset in the rewritten binary file.
StringRef OutputContents; // Rewritten section contents.
const uint64_t SectionNumber; // Order in which the section was created.
Expand Down Expand Up @@ -474,6 +475,11 @@ class BinarySection {
/// Use name \p SectionName for the section during the emission.
void emitAsData(MCStreamer &Streamer, const Twine &SectionName) const;

/// Write finalized contents of the section. If OutputSize exceeds the size of
/// the OutputContents, append zero padding to the stream and return the
/// number of byte written which should match the OutputSize.
uint64_t write(raw_ostream &OS) const;

using SymbolResolverFuncTy = llvm::function_ref<uint64_t(const MCSymbol *)>;

/// Flush all pending relocations to patch original contents of sections
Expand All @@ -497,6 +503,9 @@ class BinarySection {
IsFinalized = true;
}

/// When writing section contents, add \p PaddingSize zero bytes at the end.
void addPadding(uint64_t PaddingSize) { OutputSize += PaddingSize; }

/// Reorder the contents of this section according to /p Order. If
/// /p Inplace is true, the entire contents of the section is reordered,
/// otherwise the new contents contain only the reordered data.
Expand Down
91 changes: 51 additions & 40 deletions bolt/lib/Core/BinaryEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,17 +416,6 @@ void BinaryEmitter::emitFunctionBody(BinaryFunction &BF, FunctionFragment &FF,
BF.duplicateConstantIslands();
}

if (!FF.empty() && FF.front()->isLandingPad()) {
assert(!FF.front()->isEntryPoint() &&
"Landing pad cannot be entry point of function");
// If the first block of the fragment is a landing pad, it's offset from the
// start of the area that the corresponding LSDA describes is zero. In this
// case, the call site entries in that LSDA have 0 as offset to the landing
// pad, which the runtime interprets as "no handler". To prevent this,
// insert some padding.
Streamer.emitBytes(BC.MIB->getTrapFillValue());
}

// Track the first emitted instruction with debug info.
bool FirstInstr = true;
for (BinaryBasicBlock *const BB : FF) {
Expand Down Expand Up @@ -926,39 +915,54 @@ void BinaryEmitter::emitLSDA(BinaryFunction &BF, const FunctionFragment &FF) {
// Emit the LSDA header.

// If LPStart is omitted, then the start of the FDE is used as a base for
// landing pad displacements. Then if a cold fragment starts with
// a landing pad, this means that the first landing pad offset will be 0.
// As a result, the exception handling runtime will ignore this landing pad
// because zero offset denotes the absence of a landing pad.
// For this reason, when the binary has fixed starting address we emit LPStart
// as 0 and output the absolute value of the landing pad in the table.
// landing pad displacements. Then, if a cold fragment starts with a landing
// pad, this means that the first landing pad offset will be 0. However, C++
// runtime treats 0 as if there is no landing pad present, thus we *must* emit
// non-zero offsets for all valid LPs.
//
// If the base address can change, we cannot use absolute addresses for
// landing pads (at least not without runtime relocations). Hence, we fall
// back to emitting landing pads relative to the FDE start.
// As we are emitting label differences, we have to guarantee both labels are
// defined in the same section and hence cannot place the landing pad into a
// cold fragment when the corresponding call site is in the hot fragment.
// Because of this issue and the previously described issue of possible
// zero-offset landing pad we have to place landing pads in the same section
// as the corresponding invokes for shared objects.
// As a solution, for fixed-address binaries we set LPStart to 0, and for
// position-independent binaries we set LP start to FDE start minus one byte
// for FDEs that start with a landing pad.
const bool NeedsLPAdjustment = !FF.empty() && FF.front()->isLandingPad();
std::function<void(const MCSymbol *)> emitLandingPad;
if (BC.HasFixedLoadAddress) {
Streamer.emitIntValue(dwarf::DW_EH_PE_udata4, 1); // LPStart format
Streamer.emitIntValue(0, 4); // LPStart
emitLandingPad = [&](const MCSymbol *LPSymbol) {
if (!LPSymbol)
Streamer.emitIntValue(0, 4);
else
if (LPSymbol)
Streamer.emitSymbolValue(LPSymbol, 4);
else
Streamer.emitIntValue(0, 4);
};
} else {
Streamer.emitIntValue(dwarf::DW_EH_PE_omit, 1); // LPStart format
if (NeedsLPAdjustment) {
// Use relative LPStart format and emit LPStart as [SymbolStart - 1].
Streamer.emitIntValue(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4, 1);
MCSymbol *DotSymbol = BC.Ctx->createTempSymbol("LPBase");
Streamer.emitLabel(DotSymbol);

const MCExpr *LPStartExpr = MCBinaryExpr::createSub(
MCSymbolRefExpr::create(StartSymbol, *BC.Ctx),
MCSymbolRefExpr::create(DotSymbol, *BC.Ctx), *BC.Ctx);
LPStartExpr = MCBinaryExpr::createSub(
LPStartExpr, MCConstantExpr::create(1, *BC.Ctx), *BC.Ctx);
Streamer.emitValue(LPStartExpr, 4);
} else {
// DW_EH_PE_omit means FDE start (StartSymbol) will be used as LPStart.
Streamer.emitIntValue(dwarf::DW_EH_PE_omit, 1);
}
emitLandingPad = [&](const MCSymbol *LPSymbol) {
if (!LPSymbol)
Streamer.emitIntValue(0, 4);
else
Streamer.emitAbsoluteSymbolDiff(LPSymbol, StartSymbol, 4);
if (LPSymbol) {
const MCExpr *LPOffsetExpr = MCBinaryExpr::createSub(
MCSymbolRefExpr::create(LPSymbol, *BC.Ctx),
MCSymbolRefExpr::create(StartSymbol, *BC.Ctx), *BC.Ctx);
if (NeedsLPAdjustment)
LPOffsetExpr = MCBinaryExpr::createAdd(
LPOffsetExpr, MCConstantExpr::create(1, *BC.Ctx), *BC.Ctx);
Streamer.emitULEB128Value(LPOffsetExpr);
} else {
Streamer.emitULEB128IntValue(0);
}
};
}

Expand All @@ -972,10 +976,12 @@ void BinaryEmitter::emitLSDA(BinaryFunction &BF, const FunctionFragment &FF) {
Streamer.emitLabel(TTBaseRefLabel);
}

// Emit the landing pad call site table. We use signed data4 since we can emit
// a landing pad in a different part of the split function that could appear
// earlier in the address space than LPStart.
Streamer.emitIntValue(dwarf::DW_EH_PE_sdata4, 1);
// Emit encoding of entries in the call site table. The format is used for the
// call site start, length, and corresponding landing pad.
if (BC.HasFixedLoadAddress)
Streamer.emitIntValue(dwarf::DW_EH_PE_sdata4, 1);
else
Streamer.emitIntValue(dwarf::DW_EH_PE_uleb128, 1);

MCSymbol *CSTStartLabel = BC.Ctx->createTempSymbol("CSTStart");
MCSymbol *CSTEndLabel = BC.Ctx->createTempSymbol("CSTEnd");
Expand All @@ -992,8 +998,13 @@ void BinaryEmitter::emitLSDA(BinaryFunction &BF, const FunctionFragment &FF) {

// Start of the range is emitted relative to the start of current
// function split part.
Streamer.emitAbsoluteSymbolDiff(BeginLabel, StartSymbol, 4);
Streamer.emitAbsoluteSymbolDiff(EndLabel, BeginLabel, 4);
if (BC.HasFixedLoadAddress) {
Streamer.emitAbsoluteSymbolDiff(BeginLabel, StartSymbol, 4);
Streamer.emitAbsoluteSymbolDiff(EndLabel, BeginLabel, 4);
} else {
Streamer.emitAbsoluteSymbolDiffAsULEB128(BeginLabel, StartSymbol);
Streamer.emitAbsoluteSymbolDiffAsULEB128(EndLabel, BeginLabel);
}
emitLandingPad(CallSite.LP);
Streamer.emitULEB128IntValue(CallSite.Action);
}
Expand Down
9 changes: 9 additions & 0 deletions bolt/lib/Core/BinarySection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ void BinarySection::emitAsData(MCStreamer &Streamer,
Streamer.emitLabel(BC.Ctx->getOrCreateSymbol("__hot_data_end"));
}

uint64_t BinarySection::write(raw_ostream &OS) const {
const uint64_t NumValidContentBytes =
std::min<uint64_t>(getOutputContents().size(), getOutputSize());
OS.write(getOutputContents().data(), NumValidContentBytes);
if (getOutputSize() > NumValidContentBytes)
OS.write_zeros(getOutputSize() - NumValidContentBytes);
return getOutputSize();
}

void BinarySection::flushPendingRelocations(raw_pwrite_stream &OS,
SymbolResolverFuncTy Resolver) {
if (PendingRelocations.empty() && Patches.empty())
Expand Down
136 changes: 96 additions & 40 deletions bolt/lib/Rewrite/RewriteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3887,6 +3887,43 @@ void RewriteInstance::mapCodeSections(BOLTLinker::SectionMapper MapSection) {

void RewriteInstance::mapAllocatableSections(
BOLTLinker::SectionMapper MapSection) {

if (opts::UseOldText || opts::StrictMode) {
auto tryRewriteSection = [&](BinarySection &OldSection,
BinarySection &NewSection) {
if (OldSection.getSize() < NewSection.getOutputSize())
return;

BC->outs() << "BOLT-INFO: rewriting " << OldSection.getName()
<< " in-place\n";

NewSection.setOutputAddress(OldSection.getAddress());
NewSection.setOutputFileOffset(OldSection.getInputFileOffset());
MapSection(NewSection, OldSection.getAddress());

// Pad contents with zeros.
NewSection.addPadding(OldSection.getSize() - NewSection.getOutputSize());

// Prevent the original section name from appearing in the section header
// table.
OldSection.setAnonymous(true);
};

if (EHFrameSection) {
BinarySection *NewEHFrameSection =
getSection(getNewSecPrefix() + getEHFrameSectionName());
assert(NewEHFrameSection && "New contents expected for .eh_frame");
tryRewriteSection(*EHFrameSection, *NewEHFrameSection);
}
BinarySection *EHSection = getSection(".gcc_except_table");
BinarySection *NewEHSection =
getSection(getNewSecPrefix() + ".gcc_except_table");
if (EHSection) {
assert(NewEHSection && "New contents expected for .gcc_except_table");
tryRewriteSection(*EHSection, *NewEHSection);
}
}

// Allocate read-only sections first, then writable sections.
enum : uint8_t { ST_READONLY, ST_READWRITE };
for (uint8_t SType = ST_READONLY; SType <= ST_READWRITE; ++SType) {
Expand Down Expand Up @@ -4164,7 +4201,6 @@ void RewriteInstance::rewriteNoteSections() {
// New section size.
uint64_t Size = 0;
bool DataWritten = false;
uint8_t *SectionData = nullptr;
// Copy over section contents unless it's one of the sections we overwrite.
if (!willOverwriteSection(SectionName)) {
Size = Section.sh_size;
Expand Down Expand Up @@ -4196,12 +4232,7 @@ void RewriteInstance::rewriteNoteSections() {
if (BSec->getAllocAddress()) {
assert(!DataWritten && "Writing section twice.");
(void)DataWritten;
SectionData = BSec->getOutputData();

LLVM_DEBUG(dbgs() << "BOLT-DEBUG: " << (Size ? "appending" : "writing")
<< " contents to section " << SectionName << '\n');
OS.write(reinterpret_cast<char *>(SectionData), BSec->getOutputSize());
Size += BSec->getOutputSize();
Size += BSec->write(OS);
}

BSec->setOutputFileOffset(NextAvailableOffset);
Expand Down Expand Up @@ -4232,8 +4263,7 @@ void RewriteInstance::rewriteNoteSections() {
<< " of size " << Section.getOutputSize() << " at offset 0x"
<< Twine::utohexstr(Section.getOutputFileOffset()) << '\n');

OS.write(Section.getOutputContents().data(), Section.getOutputSize());
NextAvailableOffset += Section.getOutputSize();
NextAvailableOffset += Section.write(OS);
}
}

Expand Down Expand Up @@ -4347,6 +4377,10 @@ RewriteInstance::getOutputSections(ELFObjectFile<ELFT> *File,
BinarySection *BinSec = BC->getSectionForSectionRef(SecRef);
assert(BinSec && "Matching BinarySection should exist.");

// Exclude anonymous sections.
if (BinSec->isAnonymous())
continue;

addSection(Section, *BinSec);
}

Expand Down Expand Up @@ -5699,8 +5733,8 @@ void RewriteInstance::rewriteFile() {
<< Twine::utohexstr(Section.getAllocAddress()) << "\n of size "
<< Section.getOutputSize() << "\n at offset "
<< Section.getOutputFileOffset() << '\n';
OS.pwrite(reinterpret_cast<const char *>(Section.getOutputData()),
Section.getOutputSize(), Section.getOutputFileOffset());
OS.seek(Section.getOutputFileOffset());
Section.write(OS);
}

for (BinarySection &Section : BC->allocatableSections())
Expand Down Expand Up @@ -5791,42 +5825,64 @@ void RewriteInstance::writeEHFrameHeader() {
LLVM_DEBUG(dbgs() << "BOLT: writing a new " << getEHFrameHdrSectionName()
<< '\n');

NextAvailableAddress =
appendPadding(Out->os(), NextAvailableAddress, EHFrameHdrAlign);
// Try to overwrite the original .eh_frame_hdr if the size permits.
uint64_t EHFrameHdrOutputAddress = 0;
uint64_t EHFrameHdrFileOffset = 0;
std::vector<char> NewEHFrameHdr;
BinarySection *OldEHFrameHdrSection = getSection(getEHFrameHdrSectionName());
if (OldEHFrameHdrSection) {
NewEHFrameHdr = CFIRdWrt->generateEHFrameHeader(
RelocatedEHFrame, NewEHFrame, OldEHFrameHdrSection->getAddress());
if (NewEHFrameHdr.size() <= OldEHFrameHdrSection->getSize()) {
BC->outs() << "BOLT-INFO: rewriting " << getEHFrameHdrSectionName()
<< " in-place\n";
EHFrameHdrOutputAddress = OldEHFrameHdrSection->getAddress();
EHFrameHdrFileOffset = OldEHFrameHdrSection->getInputFileOffset();
} else {
OldEHFrameHdrSection->setOutputName(getOrgSecPrefix() +
getEHFrameHdrSectionName());
OldEHFrameHdrSection = nullptr;
}
}

const uint64_t EHFrameHdrOutputAddress = NextAvailableAddress;
const uint64_t EHFrameHdrFileOffset =
getFileOffsetForAddress(NextAvailableAddress);
// If there was not enough space, allocate more memory for .eh_frame_hdr.
if (!OldEHFrameHdrSection) {
NextAvailableAddress =
appendPadding(Out->os(), NextAvailableAddress, EHFrameHdrAlign);

std::vector<char> NewEHFrameHdr = CFIRdWrt->generateEHFrameHeader(
RelocatedEHFrame, NewEHFrame, EHFrameHdrOutputAddress);
EHFrameHdrOutputAddress = NextAvailableAddress;
EHFrameHdrFileOffset = getFileOffsetForAddress(NextAvailableAddress);

NewEHFrameHdr = CFIRdWrt->generateEHFrameHeader(
RelocatedEHFrame, NewEHFrame, EHFrameHdrOutputAddress);

NextAvailableAddress += NewEHFrameHdr.size();
if (!BC->BOLTReserved.empty() &&
(NextAvailableAddress > BC->BOLTReserved.end())) {
BC->errs() << "BOLT-ERROR: unable to fit " << getEHFrameHdrSectionName()
<< " into reserved space\n";
exit(1);
}

// Create a new entry in the section header table.
const unsigned Flags = BinarySection::getFlags(/*IsReadOnly=*/true,
/*IsText=*/false,
/*IsAllocatable=*/true);
BinarySection &EHFrameHdrSec = BC->registerOrUpdateSection(
getNewSecPrefix() + getEHFrameHdrSectionName(), ELF::SHT_PROGBITS,
Flags, nullptr, NewEHFrameHdr.size(), /*Alignment=*/1);
EHFrameHdrSec.setOutputFileOffset(EHFrameHdrFileOffset);
EHFrameHdrSec.setOutputAddress(EHFrameHdrOutputAddress);
EHFrameHdrSec.setOutputName(getEHFrameHdrSectionName());
}

Out->os().seek(EHFrameHdrFileOffset);
Out->os().write(NewEHFrameHdr.data(), NewEHFrameHdr.size());

const unsigned Flags = BinarySection::getFlags(/*IsReadOnly=*/true,
/*IsText=*/false,
/*IsAllocatable=*/true);
BinarySection *OldEHFrameHdrSection = getSection(getEHFrameHdrSectionName());
// Pad the contents if overwriting in-place.
if (OldEHFrameHdrSection)
OldEHFrameHdrSection->setOutputName(getOrgSecPrefix() +
getEHFrameHdrSectionName());

BinarySection &EHFrameHdrSec = BC->registerOrUpdateSection(
getNewSecPrefix() + getEHFrameHdrSectionName(), ELF::SHT_PROGBITS, Flags,
nullptr, NewEHFrameHdr.size(), /*Alignment=*/1);
EHFrameHdrSec.setOutputFileOffset(EHFrameHdrFileOffset);
EHFrameHdrSec.setOutputAddress(EHFrameHdrOutputAddress);
EHFrameHdrSec.setOutputName(getEHFrameHdrSectionName());

NextAvailableAddress += EHFrameHdrSec.getOutputSize();

if (!BC->BOLTReserved.empty() &&
(NextAvailableAddress > BC->BOLTReserved.end())) {
BC->errs() << "BOLT-ERROR: unable to fit " << getEHFrameHdrSectionName()
<< " into reserved space\n";
exit(1);
}
Out->os().write_zeros(OldEHFrameHdrSection->getSize() -
NewEHFrameHdr.size());

// Merge new .eh_frame with the relocated original so that gdb can locate all
// FDEs.
Expand Down
12 changes: 12 additions & 0 deletions bolt/test/eh-frame-hdr.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Check that llvm-bolt overwrites .eh_frame_hdr in-place.

REQUIRES: system-linux

RUN: %clang %cflags %p/Inputs/hello.c -o %t -Wl,-q
RUN: llvm-bolt %t -o %t.bolt --use-old-text \
RUN: | FileCheck %s --check-prefix=CHECK-BOLT
RUN: llvm-readelf -WS %t.bolt | FileCheck %s

CHECK-BOLT: rewriting .eh_frame_hdr in-place

CHECK-NOT: .bolt.org.eh_frame_hdr
8 changes: 8 additions & 0 deletions bolt/test/eh-frame-overwrite.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Check that llvm-bolt can overwrite .eh_frame section in-place.

REQUIRES: system-linux

RUN: %clang %cflags %p/Inputs/hello.c -o %t -Wl,-q
RUN: llvm-bolt %t -o %t.bolt --strict | FileCheck %s

CHECK: rewriting .eh_frame in-place
Loading