LLVM/project 564b027clang/docs ReleaseNotes.md, clang/lib/Sema SemaOverload.cpp

[clang][Modules] Keep current-TU global-module-fragment internal-linkage functions viable in overload resolution (#210825)

Fixes #210822

A `static` (or anonymous-namespace) function declared in the global
module fragment of the current TU is usable within the module unit
([module.global.frag]/p1), but `Sema::AddOverloadCandidate` dropped it
from the overload set when `Function->isInAnotherModuleUnit()` misfired
— which it does when the enclosing template is instantiated after the
GMF closes (pending instantiations run in
`ActOnEndOfTranslationUnitFragment`, before the named module is in
scope). The candidate was removed with the hidden
`ovl_fail_module_mismatched` kind, so the error had no candidate notes.

The existing carve-out (#104701) only exempted inline /
implicitly-instantiated GMF functions. This also exempts
internal-linkage functions from the current TU's GMF
(`isFromGlobalModule() && !isFromASTFile()`); genuinely imported
internal-linkage functions stay subject to the rule.

    [8 lines not shown]
DeltaFile
+37-0clang/test/Modules/gmf-internal-linkage-in-template.cppm
+10-1clang/lib/Sema/SemaOverload.cpp
+7-0clang/docs/ReleaseNotes.md
+54-13 files

LLVM/project 3c8a909llvm/utils/gn/secondary/llvm/unittests/MC BUILD.gn

[gn build] Port db816fe2ed4e (#211157)
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/unittests/MC/BUILD.gn
+1-01 files

LLVM/project 494a848llvm/utils/gn/secondary/llvm/unittests/DWARFLinkerParallel BUILD.gn

[gn build] Port acb8fbe83ff1 (#211156)
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/unittests/DWARFLinkerParallel/BUILD.gn
+1-01 files

LLVM/project 0cf2955compiler-rt/test/rtsan halt_on_error.cpp

[compiler-rt][rtsan] Loosen requirements of halt_on_error test (#210734)

Some systems may call other intercepted functions during the course of a
`malloc`. This would result in some error stack such as:

```
 ERROR malloc
     ERROR pthread_mutex_lock
     ERROR pthread_mutex_unlock
     
 ERROR free
     ERROR pthread_mutex_lock
     ERROR pthread_mutex_unlock
```

We support this as RTSan, but this test would be overly specific on
those platforms. As written, this requires "only malloc, then free
immediately after". The change makes this "at least malloc is called,
and then later at least free is called". This still keeps the spirit of

    [14 lines not shown]
DeltaFile
+1-1compiler-rt/test/rtsan/halt_on_error.cpp
+1-11 files

LLVM/project cd9537fclang/lib/CodeGen BackendUtil.cpp, clang/test/CodeGen linking-bitcode-postopt.cpp

[Clang][LTO] Assign GUIDs after post-opt bitcode linking

Run AssignGUIDPass after LinkInModulesPass so newly linked globals have
GUIDs before LTO summary emission.
DeltaFile
+4-1clang/lib/CodeGen/BackendUtil.cpp
+1-1clang/test/CodeGen/linking-bitcode-postopt.cpp
+5-22 files

LLVM/project 6e649aabolt/include/bolt/Core DebugData.h, bolt/lib/Core BinaryContext.cpp DIEBuilder.cpp

Refactoring suggested by Alexander
DeltaFile
+21-33bolt/lib/Rewrite/DWARFRewriter.cpp
+4-25bolt/lib/Core/BinaryContext.cpp
+5-15bolt/lib/Core/DIEBuilder.cpp
+19-0bolt/lib/Core/DebugData.cpp
+15-0bolt/include/bolt/Core/DebugData.h
+64-735 files

LLVM/project 373df74llvm/lib/Target/RISCV/GISel RISCVLegalizerInfo.cpp, llvm/test/CodeGen/RISCV/GlobalISel atomicrmw-max-min-umax-umin.ll legalizer-info-validation.mir

[RISCV][GlobalISel] Legalize G_ATOMICRMW_MAX/MIN/UMAX/UMIN (#210891)

Add a legalizer rule that marks these legal at `sXLen` under `+a`
(selecting `amomax.w/d`, and `amomax.b/h` for sub-word under `+zabha`
via the existing widen-scalar-while-preserving-the-memoperand path), and
handle the `llvm.riscv.masked.atomicrmw.{max,min,umax,umin}` intrinsics
the same way as `add/sub/xchg` so sub-word values without `+zabha` use
the LR/SC masking pseudos. There is no `__atomic_fetch_max/min` libcall,
so unlike `add/and/or/xor` the rule does not libcall the no-A case; that
case is already lowered by an IR-level compare-exchange loop and never
reaches GlobalISel, so the rule marks it unsupported to keep the rule
set well-defined.

Updates `legalizer-info-validation.mir` for the newly defined rules and
adds `atomicrmw-max-min-umax-umin.ll`.
DeltaFile
+13,068-0llvm/test/CodeGen/RISCV/GlobalISel/atomicrmw-max-min-umax-umin.ll
+11-8llvm/test/CodeGen/RISCV/GlobalISel/legalizer-info-validation.mir
+10-0llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
+13,089-83 files

LLVM/project 14bfc42llvm/utils/lit/lit run.py main.py

Reland "[lit] Migrate lit to ProcessPoolExecutor (#202681)" (#209076)

We want lit's test-execution engine on concurrent.futures.ProcessPoolExecutor
instead of multiprocessing.Pool as it fixes two latent bugs in the old wait
loop and is groundwork for a planned ThreadPoolExecutor/asyncio backend. It
landed as #202681 but was reverted in #206138. The reverted code deadlocks
due to two independent CPython bugs.

submit() blocks holding _shutdown_lock once the executor's wakeup pipe
fills past 16,384 undrained writes, since its own manager thread needs
that same lock to drain it (cpython gh-105829). Separately, shutdown(wait=True)
deadlocks on macOS because join_executor_internals() joins the call queue
before the workers, the reverse of the order macOS needs.

Fix: bound outstanding futures to SUBMISSION_WINDOW_PER_WORKER * workers
and submit one new test per completion instead of all up front, so the
pipe can never fill (LIT_SUBMISSION_WINDOW=0 restores the old behavior for
debugging). cancel_join_thread() before shutdown(wait=True) fixes the
macOS ordering. Also reap SIGKILL'd workers after abort instead of

    [4 lines not shown]
DeltaFile
+169-47llvm/utils/lit/lit/run.py
+2-0llvm/utils/lit/lit/main.py
+171-472 files

LLVM/project afb6844clang/lib/CIR/FrontendAction CIRGenAction.cpp, clang/lib/CIR/Lowering/DirectToLLVM LowerToLLVM.cpp

[CIR][OpenMP] Add host op filtering pass to CIR pipeline (#209592)

This patch adds the host op filtering pass which prevents host code
being lowered when compiling for the target device.
DeltaFile
+109-0mlir/include/mlir/Dialect/OpenMP/OpenMPUtils.h
+0-104mlir/include/mlir/Dialect/OpenMP/OpenMPOffloadUtils.h
+35-0clang/test/CIR/CodeGenOpenMP/target-host-op-filtering.c
+7-4clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+7-2clang/tools/cir-opt/cir-opt.cpp
+5-4clang/lib/CIR/FrontendAction/CIRGenAction.cpp
+163-1146 files not shown
+175-12012 files

LLVM/project dfa90c8llvm/test/CodeGen/AMDGPU llvm.amdgcn.permlane.ll, llvm/test/CodeGen/AMDGPU/GlobalISel legalize-load-global.mir legalize-load-local.mir

Merge branch 'llvm-main' into dbginfo-0207-up-rebased
DeltaFile
+9,414-9,234llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-global.mir
+7,009-6,937llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-local.mir
+5,819-5,824llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-private.mir
+3,848-3,728llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-constant.mir
+2,196-5,244llvm/test/CodeGen/AMDGPU/GlobalISel/insertelement.i8.ll
+3,573-3,746llvm/test/CodeGen/AMDGPU/llvm.amdgcn.permlane.ll
+31,859-34,7136,623 files not shown
+342,572-206,8776,629 files

LLVM/project 3f0919ebolt/lib/Core Relocation.cpp, bolt/test/RISCV reloc-tls.s

[BOLT][RISCV] Support the TLS global-dynamic relocation (#209995)

This patch adds BOLT support for the RISC-V TLS global-dynamic
relocation `R_RISCV_TLS_GD_HI20`. Classifying it as both a **TLS
relocation** and a **GOT-style relocation** allows BOLT to preserve the
relocation, recover the actual GOT entry address from the linked
instructions, and symbolize the instruction pair.

The RISC-V TLS relocation test is extended to cover a global-dynamic
sequence and verify that BOLT reconstructs the `AUIPC`/`PCREL_LO12` pair
correctly.
DeltaFile
+23-1bolt/test/RISCV/reloc-tls.s
+2-0bolt/lib/Core/Relocation.cpp
+25-12 files

LLVM/project acb8fbellvm/lib/DWARFLinker/Parallel DependencyTracker.cpp DWARFLinkerCompileUnit.h, llvm/unittests/DWARFLinkerParallel DIEInfoPlacementTest.cpp CMakeLists.txt

[DWARFLinker] Fix placement lost-update crash in parallel marking (#211009)
DeltaFile
+104-0llvm/unittests/DWARFLinkerParallel/DIEInfoPlacementTest.cpp
+57-34llvm/lib/DWARFLinker/Parallel/DependencyTracker.cpp
+30-0llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.h
+7-0llvm/unittests/DWARFLinkerParallel/CMakeLists.txt
+198-344 files

LLVM/project 3a2ea7flldb/source/Plugins/DynamicLoader/MacOSX-DYLD DynamicLoaderDarwin.cpp DynamicLoaderMacOSXDYLD.cpp

[lldb] Change DynamicLoaderDarwin::Segment::name type (#210797)

No need to be a ConstString, Mach-O segment names are always 16 bytes
long. Because this struct is shared for both segment_command and
segment_command_64, I opted to keep the definition instead of replacing
it with one of llvm's MachO structs.

I chose a 17-byte character array so that whatever goes into it can
always be treated as a null-terminated C string.
DeltaFile
+19-18lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+7-5lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+5-2lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h
+31-253 files

LLVM/project 6d91e20llvm/lib/Transforms/Vectorize/SandboxVectorizer VecUtils.cpp, llvm/test/Transforms/SandboxVectorizer topdown_vec.ll

[SBVec] Track claimed users across bundles
DeltaFile
+38-13llvm/test/Transforms/SandboxVectorizer/topdown_vec.ll
+13-3llvm/lib/Transforms/Vectorize/SandboxVectorizer/VecUtils.cpp
+51-162 files

LLVM/project 888483dllvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes BottomUpVec.h, llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes BottomUpVec.cpp

[SBVec] Refactor BottomUpVec pass for clarity and maintainability

- Corrected comments to clarify the direction of def-use and use-def chains.
- Changed the initialization of the SchedDirection variable to improve clarity.
- Updated documentation in vectorizeRec() to better describe the purpose of UserBndl.
- Removed outdated TODO comment regarding top-down vectorization scheduling.
DeltaFile
+5-4llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h
+1-6llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp
+6-102 files

LLVM/project 342e31dllvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes BottomUpVec.cpp, llvm/test/Transforms/SandboxVectorizer topdown_vec.ll

3 element tests

- nits
DeltaFile
+130-5llvm/test/Transforms/SandboxVectorizer/topdown_vec.ll
+0-4llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp
+130-92 files

LLVM/project 83ca453llvm/lib/Transforms/Vectorize/SandboxVectorizer VecUtils.cpp, llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes BottomUpVec.cpp

[SBVec] Add top-down vectorization to the unified Sandbox Vectorizer

Extend the Sandbox Vectorizer's `bottom-up-vec` pass so a single
implementation can vectorize in either direction, and add the top-down
strategy that walks def-use chains forward from a seed.

Direction selection
--------------------
The pass direction is chosen from the Region's auxiliary pass argument:
"bottom-up" (or empty, the default) and "top-down" map onto a
SchedDirection, and any other value is rejected with a fatal usage error.
The vectorizer always runs in the same direction as the scheduler.

Top-down traversal
------------------
Bottom-up starts from a seed slice (e.g. stores to consecutive addresses)
and recurses into operands. Top-down instead starts from a seed of
consecutive loads and recurses into *users*:


    [32 lines not shown]
DeltaFile
+441-0llvm/test/Transforms/SandboxVectorizer/topdown_vec.ll
+229-0llvm/unittests/Transforms/Vectorize/SandboxVectorizer/VecUtilsTest.cpp
+90-27llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp
+79-0llvm/lib/Transforms/Vectorize/SandboxVectorizer/VecUtils.cpp
+68-9llvm/test/Transforms/SandboxVectorizer/pack.ll
+68-0llvm/test/Transforms/SandboxVectorizer/external_uses.ll
+975-362 files not shown
+1,017-488 files

LLVM/project 9ab51a6llvm/test/Transforms/SandboxVectorizer topdown_vec.ll

Add 3-way test to check for consecutive matching
DeltaFile
+45-0llvm/test/Transforms/SandboxVectorizer/topdown_vec.ll
+45-01 files

LLVM/project 08efe1cllvm/lib/Transforms/Vectorize/SandboxVectorizer Scheduler.cpp, llvm/unittests/Transforms/Vectorize/SandboxVectorizer SchedulerTest.cpp

[SBVec] Refill ready list during topdown scheduling

Visit nodes which are ready according to the direction of scheduling.
DeltaFile
+28-0llvm/unittests/Transforms/Vectorize/SandboxVectorizer/SchedulerTest.cpp
+9-3llvm/lib/Transforms/Vectorize/SandboxVectorizer/Scheduler.cpp
+37-32 files

LLVM/project fe1fea5libc/src/__support/CPP string.h, libc/test/src/__support/CPP string_test.cpp

Handle self-move-assignment
DeltaFile
+7-0libc/test/src/__support/CPP/string_test.cpp
+3-0libc/src/__support/CPP/string.h
+10-02 files

LLVM/project 132a04dlibc/src/__support/CPP string.h CMakeLists.txt, libc/test/src/__support/CPP string_test.cpp

Remove now unused deps
DeltaFile
+18-17libc/src/__support/CPP/string.h
+14-5libc/test/src/__support/CPP/string_test.cpp
+1-4utils/bazel/llvm-project-overlay/libc/test/src/__support/CPP/BUILD.bazel
+0-2libc/src/__support/CPP/CMakeLists.txt
+0-2utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+33-305 files

LLVM/project 8b9cce3lldb/include/lldb/Expression ExpressionVariable.h, lldb/source/Expression ExpressionVariable.cpp Materializer.cpp

Make result variables obey their dynamic values in subsequent expressions

This is a resubmit of the original patch: 6344e3aa8106dfdfb30cac36c8ca02bc4c52ce24:

Make result variables obey their dynamic values in subsequent
expressions (#168611)

When I originally submitted this, it caused intermittent flakey failures
on systems I didn't have access to, and I didn't have time to sort them
out, so I reverted the patch. I'm resubmitting this so I can run the
bots on it a few rounds to see if I can reproduce and diagnose those
intermittent failures.

Here's the commit log from the original submission describing the
change:

When you run an expression and the result has a dynamic type that is
different from the expression's static result type, we print the result
variable using the dynamic type, but at present when you use the result

    [25 lines not shown]
DeltaFile
+174-0lldb/test/API/functionalities/expr-result-var/TestCPPExprResult.py
+72-6lldb/source/Expression/ExpressionVariable.cpp
+44-18lldb/include/lldb/Expression/ExpressionVariable.h
+55-0lldb/test/API/functionalities/expr-result-var/two-bases.cpp
+25-24lldb/source/Expression/Materializer.cpp
+9-5lldb/source/Expression/LLVMUserExpression.cpp
+379-534 files not shown
+384-5610 files

LLVM/project f61e12alibc/src/__support/CPP string.h CMakeLists.txt, libc/test/src/__support/CPP string_test.cpp

Remove now unused deps
DeltaFile
+18-17libc/src/__support/CPP/string.h
+14-5libc/test/src/__support/CPP/string_test.cpp
+1-4utils/bazel/llvm-project-overlay/libc/test/src/__support/CPP/BUILD.bazel
+0-2libc/src/__support/CPP/CMakeLists.txt
+0-2utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+33-305 files

LLVM/project b11881ellvm/test/CodeGen/AMDGPU mdt-preserving-crash.ll, llvm/test/CodeGen/PowerPC subreg-postra.ll p10-spill-crun.ll

[BranchFolding] Fold away subsequent identical branches

If we have a BB that has a single conditional branch instruction it that
is identical to the previous block's branch instruction, we can delete
the BB as it is redundant.

This doesn't directly impact performance as such instructions are never
executed, but this can help decrease code size which can help with
overall icache pressure (though likely only slightly). The biggest
impact would probably be fitting more instructions into a single cache
line. This is probably almost a no-op with PLO but definitely doesn't
hurt.

Fixes #202763.

Reviewers: RKSimon, arsenm, krzysz00, topperc, lei137

Pull Request: https://github.com/llvm/llvm-project/pull/203110
DeltaFile
+93-97llvm/test/CodeGen/PowerPC/subreg-postra.ll
+52-57llvm/test/CodeGen/X86/2008-04-17-CoalescerBug.ll
+44-48llvm/test/CodeGen/PowerPC/p10-spill-crun.ll
+23-29llvm/test/CodeGen/X86/2011-09-14-valcoalesce.ll
+13-19llvm/test/CodeGen/X86/2009-11-17-UpdateTerminator.ll
+13-17llvm/test/CodeGen/AMDGPU/mdt-preserving-crash.ll
+238-2676 files not shown
+277-29312 files

LLVM/project b7fbf82llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes BottomUpVec.cpp, llvm/test/Transforms/SandboxVectorizer topdown_vec.ll

3 element tests
DeltaFile
+128-0llvm/test/Transforms/SandboxVectorizer/topdown_vec.ll
+0-4llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp
+128-42 files

LLVM/project f421cb3llvm/lib/Transforms/Vectorize/SandboxVectorizer VecUtils.cpp, llvm/test/Transforms/SandboxVectorizer topdown_vec.ll

[SBVec] Track claimed users across bundles
DeltaFile
+38-13llvm/test/Transforms/SandboxVectorizer/topdown_vec.ll
+13-3llvm/lib/Transforms/Vectorize/SandboxVectorizer/VecUtils.cpp
+51-162 files

LLVM/project 6875b35llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes BottomUpVec.h, llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes BottomUpVec.cpp

[SBVec] Refactor BottomUpVec pass for clarity and maintainability

- Corrected comments to clarify the direction of def-use and use-def chains.
- Changed the initialization of the SchedDirection variable to improve clarity.
- Updated documentation in vectorizeRec() to better describe the purpose of UserBndl.
- Removed outdated TODO comment regarding top-down vectorization scheduling.
DeltaFile
+5-4llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h
+1-6llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp
+6-102 files

LLVM/project a24292cllvm/lib/Transforms/Vectorize/SandboxVectorizer VecUtils.cpp, llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes BottomUpVec.cpp

[SBVec] Add top-down vectorization to the unified Sandbox Vectorizer

Extend the Sandbox Vectorizer's `bottom-up-vec` pass so a single
implementation can vectorize in either direction, and add the top-down
strategy that walks def-use chains forward from a seed.

Direction selection
--------------------
The pass direction is chosen from the Region's auxiliary pass argument:
"bottom-up" (or empty, the default) and "top-down" map onto a
SchedDirection, and any other value is rejected with a fatal usage error.
The vectorizer always runs in the same direction as the scheduler.

Top-down traversal
------------------
Bottom-up starts from a seed slice (e.g. stores to consecutive addresses)
and recurses into operands. Top-down instead starts from a seed of
consecutive loads and recurses into *users*:


    [32 lines not shown]
DeltaFile
+441-0llvm/test/Transforms/SandboxVectorizer/topdown_vec.ll
+229-0llvm/unittests/Transforms/Vectorize/SandboxVectorizer/VecUtilsTest.cpp
+90-27llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp
+79-0llvm/lib/Transforms/Vectorize/SandboxVectorizer/VecUtils.cpp
+68-9llvm/test/Transforms/SandboxVectorizer/pack.ll
+68-0llvm/test/Transforms/SandboxVectorizer/external_uses.ll
+975-362 files not shown
+1,017-488 files

LLVM/project aef1e4fclang/test/CodeGen target-data.c, llvm/lib/Target/NVPTX NVPTXISelLowering.cpp

[NVPTX] Support short entry param pointers (#206512)
DeltaFile
+458-229llvm/test/CodeGen/NVPTX/lower-args-gridconstant.ll
+32-0llvm/unittests/TargetParser/TripleTest.cpp
+21-9llvm/lib/TargetParser/TargetDataLayout.cpp
+6-5llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+1-1clang/test/CodeGen/target-data.c
+518-2445 files

LLVM/project 6da4586llvm/lib/Transforms/Vectorize/SandboxVectorizer Scheduler.cpp, llvm/unittests/Transforms/Vectorize/SandboxVectorizer SchedulerTest.cpp

[SBVec] Refill ready list during topdown scheduling

Visit nodes which are ready according to the direction of scheduling.
DeltaFile
+28-0llvm/unittests/Transforms/Vectorize/SandboxVectorizer/SchedulerTest.cpp
+9-3llvm/lib/Transforms/Vectorize/SandboxVectorizer/Scheduler.cpp
+37-32 files