LLVM/project d2d2885clang-tools-extra/clang-tidy/readability SimplifyBooleanExprCheck.cpp, clang-tools-extra/docs ReleaseNotes.md

[clang-tidy] Fix De Morgan for overloaded comparisons (#221432)

Before my patch:


(https://source.chromium.org/chromium/chromium/src/+/main:base/trace_event/memory_allocator_dump.cc;l=174)

```diff
-  if (!(name == rhs.name && units == rhs.units &&
-        entry_type == rhs.entry_type)) {
+  if (!name == rhs.name || !units == rhs.units ||
+        entry_type != rhs.entry_type) {
```

With the patch:

```diff
-  if (!(name == rhs.name && units == rhs.units &&
-        entry_type == rhs.entry_type)) {

    [4 lines not shown]
DeltaFile
+57-0clang-tools-extra/test/clang-tidy/checkers/readability/simplify-boolean-expr-demorgan.cpp
+23-0clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
+5-1clang-tools-extra/docs/ReleaseNotes.md
+85-13 files

LLVM/project 20b4d70flang/include/flang/Semantics openmp-utils.h, flang/lib/Semantics openmp-utils.cpp check-omp-variant.cpp

Share construct contexts for variant reachability

Use AppendDirectiveContextTraits when building reachable directive paths
so semantic checks and lowering apply the same construct-context rules.
This excludes informational directives such as ASSUME while retaining
executable loop transformations and the source order of combined constructs.

Make AppendConstructTraitsForDirective private again and add semantic
tests for TILE, UNROLL, ASSUME, and TEAMS DISTRIBUTE PARALLEL DO. These
complement the existing lowering tests. The ASSUME case detects the old
collector counting an extra position and skipping a required diagnostic.
DeltaFile
+71-0flang/test/Semantics/OpenMP/metadirective-construct-paths.f90
+2-23flang/lib/Semantics/check-omp-variant.cpp
+0-5flang/include/flang/Semantics/openmp-utils.h
+1-1flang/lib/Semantics/openmp-utils.cpp
+2-0flang/test/Driver/bbc-openmp-target-context.f90
+76-295 files

LLVM/project d357463llvm/lib/Target/RISCV RISCVAsmPrinter.cpp, llvm/test/CodeGen/RISCV module-asm-features.ll riscv-func-target-feature.ll

[RISC-V] Update streamer ArchString in emitTargetFeaturePush()

Previously, RISCVAsmPrinter::emitTargetFeaturePush() only emitted `.option push`
and `.option arch` without updating the streamer's active ArchString. When
emitting an ELF object file directly (`-filetype=obj`),
RISCVTargetELFStreamer::emitDirectiveOptionArch() is a no-op while
emitTargetFeaturePop() resets ArchString back to the pushed ArchString, so
module-level inline assembly and functions with custom `target-features` failed
to emit updated `$x<arch>` mapping symbols.

Call RTS.setArchString() with the parsed ISA string in emitTargetFeaturePush()
so `-filetype=obj` records the active `$x<arch>` mapping symbol alongside
`.option arch`.

This commit was created with the help of AI tools
DeltaFile
+2-5llvm/test/CodeGen/RISCV/module-asm-features.ll
+4-3llvm/test/CodeGen/RISCV/riscv-func-target-feature.ll
+2-0llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
+8-83 files

LLVM/project e119b18llvm/lib/Target/RISCV/AsmParser RISCVAsmParser.cpp

rebase
DeltaFile
+5-20llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
+5-201 files

LLVM/project a09b560cross-project-tests/riscv lto-inline-asm-abi.c, llvm/lib/LTO LTO.cpp

[LTO] Preserve module inline asm target properties for .lto_discard and symvers

Previously, LTO::addRegularLTO() and IRLinker::run() called
prependModuleInlineAsm() and appendModuleInlineAsm() with a plain string when
synthesizing `.lto_discard` and imported `.symver` directives, creating a new
GlobalAsmFragment with empty TargetCPU and TargetFeatures instead of preserving
the existing module inline asm's properties. Copy the front fragment's Props so
these synthesized directives are merged into the module's inline asm with the
same target features.

This commit was created with the help of AI tools
DeltaFile
+2-5cross-project-tests/riscv/lto-inline-asm-abi.c
+1-4llvm/test/LTO/RISCV/module-asm.ll
+2-1llvm/lib/Linker/IRMover.cpp
+1-1llvm/lib/LTO/LTO.cpp
+6-114 files

LLVM/project ea66d4fcross-project-tests/riscv lto-inline-asm-abi.c, llvm/test/CodeGen/RISCV module-asm-features.ll

reformat and fix tests after rebase
DeltaFile
+23-9cross-project-tests/riscv/lto-inline-asm-abi.c
+3-2llvm/test/CodeGen/RISCV/module-asm-features.ll
+26-112 files

LLVM/project 639d199llvm/lib/Analysis ConstantFolding.cpp, llvm/lib/Target/AMDGPU SIISelLowering.cpp

[AMDGPU] Constant folding for wave-reduce intrinsics (#212755)

Relates to: https://github.com/llvm/llvm-project/pull/193142
A missed optimization opportunity.
While most constants to `add`, `sub` and `xor` wave reductions
cannot be folded, some identity constants(0, 1) can do with
some special handling.
DeltaFile
+972-0llvm/test/CodeGen/AMDGPU/atomic_optimizations_mul_one.ll
+0-614llvm/test/CodeGen/AMDGPU/GlobalISel/atomic_optimizations_mul_one.ll
+41-2llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+10-0llvm/lib/Analysis/ConstantFolding.cpp
+1,023-6164 files

LLVM/project e374b8elld/ELF/Arch AArch64.cpp

Address review comments
DeltaFile
+3-4lld/ELF/Arch/AArch64.cpp
+3-41 files

LLVM/project 9c09606orc-rt/include/orc-rt/bedrock ConnectionSpec.h, orc-rt/lib/bedrock CMakeLists.txt ConnectionSpec.cpp

[orc-rt] Add ConnectionSpec, a connection-string parser (#225304)

Parses the string a process is given to describe the connection it
should establish with its peer:

  <transport>[:<action>]=<descriptor>

Checking is punctuation only: the transport and action are opaque tokens
and the descriptor's syntax belongs to the transport, so a spec parses
without knowing which transports this process was built with.

The grammar is LLVM's (#225075), so the same vocabulary reaches an
orc-rt executor and an LLVM controller. A registry mapping transports to
the connectors that implement them will be added in a follow-up commit.
DeltaFile
+96-0orc-rt/include/orc-rt/bedrock/ConnectionSpec.h
+83-0orc-rt/test/unit/bedrock/ConnectionSpecTest.cpp
+50-0orc-rt/lib/bedrock/ConnectionSpec.cpp
+1-0orc-rt/test/unit/CMakeLists.txt
+1-0orc-rt/lib/bedrock/CMakeLists.txt
+231-05 files

LLVM/project dd713d4flang/include/flang/Semantics openmp-utils.h, flang/lib/Semantics openmp-utils.cpp check-omp-variant.cpp

Share construct contexts for variant reachability

Use AppendDirectiveContextTraits when building reachable directive paths
so semantic checks and lowering apply the same construct-context rules.
This excludes informational directives such as ASSUME while retaining
executable loop transformations and the source order of combined constructs.

Make AppendConstructTraitsForDirective private again and add semantic
tests for TILE, UNROLL, ASSUME, and TEAMS DISTRIBUTE PARALLEL DO. These
complement the existing lowering tests. The ASSUME case detects the old
collector counting an extra position and skipping a required diagnostic.
DeltaFile
+71-0flang/test/Semantics/OpenMP/metadirective-construct-paths.f90
+2-23flang/lib/Semantics/check-omp-variant.cpp
+0-5flang/include/flang/Semantics/openmp-utils.h
+1-1flang/lib/Semantics/openmp-utils.cpp
+74-294 files

LLVM/project 8c6b303flang/lib/Semantics check-omp-variant.cpp, flang/test/Semantics/OpenMP metadirective-construct-paths.f90

Preserve OpenMP variant ranking and reachability

Incorrect scores and premature candidate rejection can change lowering
selection or suppress required metadirective loop diagnostics.

Preserve full score values and context-dependent device weights, retain
paths distinguished by those weights, and let runtime conditions satisfy
match_any despite unknown static properties.
DeltaFile
+68-0flang/test/Semantics/OpenMP/metadirective-construct-paths.f90
+1-8flang/lib/Semantics/check-omp-variant.cpp
+69-82 files

LLVM/project 1c94e50flang/test/Driver bbc-openmp-target-context.f90, flang/tools/bbc bbc.cpp

Set bbc target context for semantics
DeltaFile
+17-0flang/test/Driver/bbc-openmp-target-context.f90
+2-0flang/tools/bbc/bbc.cpp
+19-02 files

LLVM/project c4517aaflang/lib/Semantics check-omp-variant.cpp, flang/test/Semantics/OpenMP metadirective-construct-paths.f90

Count all enclosing leaves in reachable paths

Reachability must use the same construct positions and depth as lowering
when ranking metadirective replacements. Count source constructs without
selector traits, including leaves of combined directives, while keeping
NOTHING transparent.

Add regressions for actual and dynamically selected TASK regions and
DISTRIBUTE within TEAMS DISTRIBUTE PARALLEL DO.
DeltaFile
+53-0flang/test/Semantics/OpenMP/metadirective-construct-paths.f90
+17-4flang/lib/Semantics/check-omp-variant.cpp
+70-42 files

LLVM/project 87a6f66flang/lib/Semantics openmp-utils.cpp, flang/test/Semantics/OpenMP metadirective-common.f90

Reject negative trait scores during metadirective recovery

Reachability analysis can rank candidates before CheckTraitScore diagnoses
invalid scores. A score of -1 wraps the initial unsigned score to zero,
causing selection to dereference a null best candidate.

Treat negative scores as absent during recovery while preserving the
existing diagnostic.
DeltaFile
+27-0flang/test/Semantics/OpenMP/metadirective-common.f90
+4-1flang/lib/Semantics/openmp-utils.cpp
+31-12 files

LLVM/project 6ac00faflang/lib/Semantics check-omp-structure.h check-omp-structure.cpp, flang/test/Semantics/OpenMP metadirective-construct-paths.f90

Preserve reachable metadirective variants across ranking and scopes

Incorrect candidate scores and stale scope boundaries can suppress required
loop diagnostics or let directives associate with loops outside their region.

Keep pending scopes consistent as directives are consumed, and preserve
candidate scores and highest-valued ordered matches when selecting and
merging reachable paths. Handle unknown properties without aborting ranking.
DeltaFile
+146-0flang/test/Semantics/OpenMP/metadirective-construct-paths.f90
+20-2flang/lib/Semantics/check-omp-variant.cpp
+10-0flang/lib/Semantics/check-omp-structure.cpp
+1-0flang/lib/Semantics/check-omp-structure.h
+177-24 files

LLVM/project fe2db48flang/lib/Semantics check-omp-variant.cpp, flang/test/Semantics/OpenMP metadirective-ordered-paths.f90 metadirective-loop-applicability.f90

Fix extension matching and reachable path merging

Metadirective semantic checking relies on ranked selection to decide which
replacements need validation. With match_any and match_none, a selector can
remain applicable even when some construct traits are absent. The existing
matching and path-merging assumptions do not fully account for this, so
ranking can crash or discard a reachable replacement, allowing invalid loop
nests to pass unchecked.

Make applicability, scoring, and reachable-path merging agree on what these
matching extensions can observe. Preserve enough construct context to rank
partially matching selectors and distinguish paths whose nesting changes
the selected replacement. That context must also remain visible inside a
BLOCK associated with a selected directive, so nested metadirectives are
checked against the context in which they can execute.
DeltaFile
+53-34flang/lib/Semantics/check-omp-variant.cpp
+71-0flang/test/Semantics/OpenMP/metadirective-match-any-paths.f90
+68-0flang/test/Semantics/OpenMP/metadirective-loop-applicability.f90
+45-0flang/test/Semantics/OpenMP/metadirective-ordered-paths.f90
+237-344 files

LLVM/project 59b4198flang/lib/Semantics check-omp-structure.h check-omp-variant.cpp, flang/test/Semantics/OpenMP metadirective-loop-applicability-openmp-60.f90 metadirective-loop-applicability.f90

Fix metadirective reachable path boundaries

Stop construct trait paths at the innermost target and retain the implicit
nothing fallback during unsupported-selector recovery.

Add coverage for actual and selected target boundaries and for nested
metadirectives reached through implicit fallback.
DeltaFile
+23-13flang/lib/Semantics/check-omp-variant.cpp
+32-0flang/test/Semantics/OpenMP/metadirective-loop-applicability.f90
+16-0flang/test/Semantics/OpenMP/metadirective-loop-applicability-openmp-60.f90
+2-0flang/lib/Semantics/check-omp-structure.h
+73-134 files

LLVM/project 32a842cflang/include/flang/Semantics openmp-utils.h, flang/lib/Semantics openmp-utils.cpp check-omp-variant.cpp

Respect target boundaries during OpenMP variant lowering

Stop collecting construct traits at the innermost TARGET so lowering
agrees with semantic analysis when selecting metadirective replacements
and DECLARE VARIANT callees.
DeltaFile
+5-6flang/lib/Semantics/check-omp-variant.cpp
+2-6flang/lib/Semantics/openmp-utils.cpp
+4-4flang/test/Semantics/OpenMP/metadirective-construct-paths.f90
+4-3flang/test/Lower/OpenMP/metadirective-target-boundary.f90
+1-2flang/test/Lower/OpenMP/metadirective-construct.f90
+2-1flang/include/flang/Semantics/openmp-utils.h
+18-226 files

LLVM/project d6c762fflang/lib/Semantics openmp-utils.cpp, flang/test/Semantics/OpenMP metadirective-loop-applicability-apply.f90 metadirective-ordered-paths.f90

Preserve metadirective selection semantics

Reachability checks can miss required loop diagnostics when selection
drops SIMD traits or treats NOTHING with APPLY as a no-op.

Preserve those distinctions in the shared selection plan so semantic
checks retain reachable transformations and lowering diagnoses
unsupported cases.
DeltaFile
+185-0flang/test/Semantics/OpenMP/metadirective-construct-paths.f90
+106-5flang/test/Semantics/OpenMP/metadirective-loop-applicability-openmp-60.f90
+0-71flang/test/Semantics/OpenMP/metadirective-match-any-paths.f90
+27-21flang/lib/Semantics/openmp-utils.cpp
+0-45flang/test/Semantics/OpenMP/metadirective-ordered-paths.f90
+0-23flang/test/Semantics/OpenMP/metadirective-loop-applicability-apply.f90
+318-1656 files not shown
+365-17412 files

LLVM/project 2b4a461flang/lib/Semantics check-omp-structure.h check-omp-structure.cpp, flang/test/Semantics/OpenMP metadirective-loop-applicability-openmp-60.f90 metadirective-loop-applicability-apply.f90

[flang][OpenMP] Track reachable metadirective replacement paths

The existing semantic checks can validate loop-associated directives in a
METADIRECTIVE against the following loop, but they do not model how the
METADIRECTIVE chooses among its replacements.

Today each WHEN is considered independently: if its selector can match, its
replacement is checked. Selection instead ranks all applicable candidates as
a set. An unguarded higher-ranked candidate makes lower-ranked candidates
unreachable, while a dynamically guarded candidate leaves them reachable
when its condition is false. Treating both cases alike can diagnose loop
requirements on a replacement that can never be selected.

The selected replacement can also affect later selection. Its directive
contributes to the construct context seen by a nested metadirective. The
checker currently retains only syntactic nesting, so nested construct
selectors cannot observe a directive selected by an enclosing
metadirective.


    [44 lines not shown]
DeltaFile
+347-94flang/lib/Semantics/check-omp-variant.cpp
+186-0flang/test/Semantics/OpenMP/metadirective-loop-applicability.f90
+56-25flang/lib/Semantics/check-omp-structure.cpp
+37-13flang/lib/Semantics/check-omp-structure.h
+23-0flang/test/Semantics/OpenMP/metadirective-loop-applicability-apply.f90
+13-0flang/test/Semantics/OpenMP/metadirective-loop-applicability-openmp-60.f90
+662-1322 files not shown
+667-1338 files

LLVM/project 0da46f1flang/lib/Semantics check-omp-structure.h check-omp-variant.cpp, flang/test/Semantics/OpenMP metadirective-loop-applicability.f90

Remove redundant handling, improve style, and add documentation
DeltaFile
+13-21flang/lib/Semantics/check-omp-variant.cpp
+8-4flang/test/Semantics/OpenMP/metadirective-loop-applicability.f90
+6-4flang/lib/Semantics/check-omp-structure.h
+27-293 files

LLVM/project a28c83dlibcxx/include/__locale_dir/support windows.h

add _LIBCPP_HIDE_FROM_ABI to the __get_c_locale() forward declaration on Windows
DeltaFile
+1-1libcxx/include/__locale_dir/support/windows.h
+1-11 files

LLVM/project a2a07c7llvm/lib/Analysis ConstantFolding.cpp, llvm/lib/Target/AMDGPU SIISelLowering.cpp

[AMDGPU] Constant folding for wave-reduce intrinsics
DeltaFile
+972-0llvm/test/CodeGen/AMDGPU/atomic_optimizations_mul_one.ll
+0-614llvm/test/CodeGen/AMDGPU/GlobalISel/atomic_optimizations_mul_one.ll
+41-2llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+10-0llvm/lib/Analysis/ConstantFolding.cpp
+1,023-6164 files

LLVM/project 9ac223eutils/bazel/llvm-project-overlay/openmp/runtime/src BUILD.bazel

[Bazel] Fixes 94f5dd0 (#225300)

This fixes 94f5dd0eb25ed97603af1d0a501c412fcfea6696 (#197191).

Buildkite error link:
https://buildkite.com/llvm-project/upstream-bazel/builds?commit=94f5dd0eb25ed97603af1d0a501c412fcfea6696

Co-authored-by: Google Bazel Bot <google-bazel-bot at google.com>
DeltaFile
+2-0utils/bazel/llvm-project-overlay/openmp/runtime/src/BUILD.bazel
+2-01 files

LLVM/project 5587ab4llvm/lib/Transforms/Scalar SimpleLoopUnswitch.cpp, llvm/test/Transforms/SimpleLoopUnswitch pr138509.ll nontrivial-unswitch-trivial-select.ll

[SimpleLoopUnswitch] Allow trivial unswitch when exit LCSSA is a header PHI (#222962)

Trivial unswitch bails on a common loop shape: a loop-invariant branch
in the header that exits the loop returning a loop-carried value.

```
  int acc = 0;
  for (...) {
    if (c)
      return acc;
    acc++;
  }
```

After loop-rotate the `if` sits in the header, and the exit reads the
header PHI `%acc`. Trivial unswitch hoists the branch into the
preheader, so the exit value must be available there. It only accepts
loop-invariant values, and `%acc` is not one, so it gives up. But `%acc`
is safe here: the branch is invariant, so if the loop exits it exits on

    [10 lines not shown]
DeltaFile
+272-0llvm/test/Transforms/SimpleLoopUnswitch/trivial-unswitch-header-phi.ll
+48-25llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
+4-9llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-trivial-select.ll
+1-1llvm/test/Transforms/SimpleLoopUnswitch/pr138509.ll
+325-354 files

LLVM/project 1f73129flang/lib/Semantics resolve-names.cpp, flang/test/Semantics/CUDA cuda-pinned-implicit-modfile.cuf

[flang][cuda] Record implicit pinned attribution in module files

Under -gpu=mem:pinned an unattributed ALLOCATABLE is attributed as pinned by
the compiler, the same way -gpu=mem:managed attributes one as managed, but
only the latter recorded that it had done so. The module file therefore spelled
an implicitly applied PINNED the same as one the user wrote, and a reader
treated it as a user requirement: adding -gpu=mem:pinned to a module's build
rejected its OpenACC-only consumers over an attribute the user never wrote.

Record the attribution for pinned as well, so it is written as
PINNED(IMPLICIT) and consumers can tell the two apart.
DeltaFile
+42-0flang/test/Semantics/CUDA/cuda-pinned-implicit-modfile.cuf
+3-1flang/lib/Semantics/resolve-names.cpp
+45-12 files

LLVM/project ef8bc0allvm/include/llvm/ABI TargetInfo.h, llvm/lib/ABI TargetInfo.cpp

[ABI] Thread alloca address space through getNaturalAlignIndirect
DeltaFile
+6-4llvm/lib/ABI/Targets/BPF.cpp
+6-4llvm/lib/ABI/Targets/AArch64.cpp
+5-4llvm/lib/ABI/Targets/X86.cpp
+5-1llvm/include/llvm/ABI/TargetInfo.h
+3-2llvm/lib/ABI/TargetInfo.cpp
+2-0llvm/unittests/ABI/AArch64TargetInfoTest.cpp
+27-151 files not shown
+29-157 files

LLVM/project 15fc88amlir/include/mlir/IR BuiltinTypeInterfaces.td

[mlir][NFC] Improve `ShapedTypeInterface` documentation
DeltaFile
+6-5mlir/include/mlir/IR/BuiltinTypeInterfaces.td
+6-51 files

LLVM/project e0d9b60orc-rt/test/unit/bedrock ExecutorProcessInfoTest.cpp

[orc-rt] Fix unit test. (#225299)

Use !! to convert EPI to bool, and ExecutorProcessInfo::pageSize() to
get the page size (ExecutorProcessInfo::PageSize is private).
DeltaFile
+2-2orc-rt/test/unit/bedrock/ExecutorProcessInfoTest.cpp
+2-21 files

LLVM/project 94f5dd0openmp/runtime/src kmp_device_env.h kmp_settings.cpp, openmp/runtime/test/env omp_num_threads_dev_all_fallback.c omp_num_threads_dev_resolve.c

[libomp] OpenMP 6.0 Device-Scope Environment Variables  (#197191)

The patch introduces `_ALL` `_DEV` `_DEV_<id>` env var suffixes to the
LLVM's OpenMP host runtime `libomp`. The eligible-list env var currently
supports `OMP_NUM_THREADS`.

Assisted by Claude Opus 4.7 / Claude 4.6 Sonnet
DeltaFile
+353-0openmp/runtime/src/kmp_device_env.cpp
+57-14openmp/runtime/src/kmp_settings.cpp
+64-0openmp/runtime/src/kmp_device_env.h
+46-0openmp/runtime/test/env/omp_num_threads_dev_overflow.c
+33-0openmp/runtime/test/env/omp_num_threads_dev_resolve.c
+32-0openmp/runtime/test/env/omp_num_threads_dev_all_fallback.c
+585-1413 files not shown
+811-1419 files