LLVM/project 693ded3llvm/runtimes CMakeLists.txt

[LLVM] Fix not passing CMAKE_CROSSCOMPILING_EMULATOR for amdgpu (#209828)

Summary:
This only matches on amdgcn, just add amdgpu
DeltaFile
+1-1llvm/runtimes/CMakeLists.txt
+1-11 files

LLVM/project d3d8264clang/include/clang/Basic TargetID.h, clang/lib/Basic TargetID.cpp

clang: Use TargetID parsing from AMDGPUTargetParser

We had grown 2 parallel parsing implementations for
triple+gpu name+feature flag target ID strings. Mostly
eliminate the redundant clang version.

Co-authored-by: Claude (Opus 4.8)
DeltaFile
+29-165clang/lib/Basic/TargetID.cpp
+49-51clang/lib/Driver/ToolChains/AMDGPU.cpp
+27-41clang/lib/Driver/OffloadBundler.cpp
+7-33clang/include/clang/Basic/TargetID.h
+18-14clang/lib/Basic/Targets/AMDGPU.h
+17-14clang/lib/Basic/Targets/AMDGPU.cpp
+147-3185 files not shown
+172-34211 files

LLVM/project e6782a9llvm/include/llvm/TargetParser AMDGPUTargetParser.h, llvm/lib/TargetParser AMDGPUTargetParser.cpp

AMDGPU: Add TargetID::printCanonicalTargetIDString

Factor the canonical feature-string formatting into a raw_ostream print
method so callers can stream directly without a temporary std::string.
getCanonicalFeatureString now delegates to it.
DeltaFile
+6-2llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+5-0llvm/include/llvm/TargetParser/AMDGPUTargetParser.h
+11-22 files

LLVM/project 11725b1clang/include/clang/Basic TargetID.h, clang/lib/Basic TargetID.cpp

Fix offload bundler usage of getConflictTargetIDCombination
DeltaFile
+14-9clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
+11-9clang/include/clang/Basic/TargetID.h
+12-2clang/lib/Driver/OffloadBundler.cpp
+9-4clang/lib/Driver/Driver.cpp
+2-3clang/lib/Basic/TargetID.cpp
+48-275 files

LLVM/project 4a72f64llvm/lib/Target/AMDGPU/Utils AMDGPUBaseInfo.cpp

comment
DeltaFile
+2-1llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+2-11 files

LLVM/project dcb7fe4llvm/include/llvm/TargetParser AMDGPUTargetParser.h, llvm/lib/TargetParser AMDGPUTargetParser.cpp

AMDGPU: Remove now-unused splitTargetID

splitTargetID was a syntactic-only target-ID splitter used solely by
clang's getConflictTargetIDCombination, which now parses through the
canonical llvm::AMDGPU::TargetID::parse instead. With that last user
gone, drop the function, its declaration, and its unit test.
DeltaFile
+0-40llvm/unittests/TargetParser/TargetParserTest.cpp
+0-20llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+0-6llvm/include/llvm/TargetParser/AMDGPUTargetParser.h
+0-663 files

LLVM/project 0c84144llvm/include/llvm/TargetParser AMDGPUTargetParser.h, llvm/lib/Target/AMDGPU GCNSubtarget.h

AMDGPU: Validate processor and features in TargetID parsing

TargetID::parseTargetIDString previously only checked that the string was
structurally a 4-component triple followed by a processor field. It
accepted unrecognized processors and silently ignored malformed or
unsupported feature modifiers. Work towards improving validation so in
the future clang's copy of TargetID can be replaced.

Co-authored-by: Claude (Opus 4.8)
DeltaFile
+128-46llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+149-0llvm/unittests/TargetParser/TargetParserTest.cpp
+20-2llvm/include/llvm/TargetParser/AMDGPUTargetParser.h
+7-3llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+5-3llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
+3-1llvm/lib/Target/AMDGPU/GCNSubtarget.h
+312-551 files not shown
+313-567 files

LLVM/project 77480d9clang/include/clang/Options Options.td, clang/lib/Driver/ToolChains Clang.cpp

address comments
DeltaFile
+3-3clang/include/clang/Options/Options.td
+1-1clang/lib/Driver/ToolChains/Clang.cpp
+4-42 files

LLVM/project 0a5cc87clang/lib/AST ASTContext.cpp, clang/lib/Lex TextEncoding.cpp

Convert the key before cache lookup to prevent encoding differences
DeltaFile
+9-9clang/lib/AST/ASTContext.cpp
+1-1clang/lib/Lex/TextEncoding.cpp
+10-102 files

LLVM/project ebe3a4bclang/docs LanguageExtensions.md, clang/include/clang/Options Options.td

Enable driver changes for fexec-charset
DeltaFile
+14-6clang/lib/Driver/ToolChains/Clang.cpp
+14-4clang/include/clang/Options/Options.td
+11-3clang/test/Driver/clang_f_opts.c
+10-0llvm/lib/Support/TextEncoding.cpp
+4-3clang/test/Driver/cl-options.c
+3-3clang/docs/LanguageExtensions.md
+56-193 files not shown
+60-199 files

LLVM/project 20cd67cclang/include/clang/AST FormatString.h, clang/lib/AST FormatString.cpp PrintfFormatString.cpp

do not convert character by character
DeltaFile
+34-31clang/lib/AST/FormatString.cpp
+29-26clang/lib/AST/PrintfFormatString.cpp
+28-26clang/lib/AST/FormatStringParsing.h
+17-15clang/lib/Sema/SemaChecking.cpp
+11-11clang/lib/AST/ScanfFormatString.cpp
+2-2clang/include/clang/AST/FormatString.h
+121-1111 files not shown
+122-1127 files

LLVM/project 6b0ed1bclang/include/clang/Basic TargetInfo.h, clang/lib/AST ASTContext.cpp

convert to exec-charset inside getPredefinedStringLiteralFromCache, test __builtin_FILE()
DeltaFile
+10-0clang/lib/AST/ASTContext.cpp
+4-0clang/test/CodeGen/systemz-charset.cpp
+3-0clang/lib/Basic/TargetInfo.cpp
+2-1clang/lib/Lex/TextEncoding.cpp
+2-0clang/include/clang/Basic/TargetInfo.h
+21-15 files

OpenZFS/src 2a5331fmodule/zfs dmu_zfetch.c

Fix dmu_zfetch_prime() assuming a stream was created

dmu_zfetch_prime() calls dmu_zfetch_stream_create() and then takes
list_head(&zf->zf_stream), asserting its zs_blkid equals the requested
blkid.  But dmu_zfetch_stream_create() only inserts a new head stream
in its normal path; when zf_numstreams has reached zfetch_max_streams
and no stream is reclaimable it bumps zfetchstat_max_streams and
returns without creating one, leaving an unrelated stream at the head.
dmu_zfetch_prime() then trips VERIFY3U(zs->zs_blkid, ==, blkid) (a
debug build panics; otherwise it primes the wrong stream).

Return the created/reused stream from dmu_zfetch_stream_create(), or
NULL when it declines, and have dmu_zfetch_prime() stop priming in
that case instead of trusting list_head.  dmu_zfetch_prepare(), the
only other caller, does not use the returned stream.

This is reachable by any dmu_prefetch_stream() caller that drives more
than zfetch_max_streams concurrent streams on a dnode.


    [3 lines not shown]
DeltaFile
+10-6module/zfs/dmu_zfetch.c
+10-61 files

LLVM/project 50d9b27flang/lib/Lower/OpenMP OpenMP.cpp, flang/lib/Lower/Support ReductionProcessor.cpp

[flang][OpenMP] Lower cross-module user-defined declare reduction (#207493)

Lower a reduction clause naming a USE-associated, renamed, or merged-generic
user-defined reduction, which currently aborts lowering with a "not yet
implemented" TODO. Semantics already accepts these programs (since #200329).
This covers the defined-operator, intrinsic-operator, and named forms, each for
one or several types in a single declare reduction. One shape is still deferred.
A reduction on an allocatable or pointer operand of a trivial intrinsic element
type (integer, real, complex, or logical) is not lowered yet and reaches a clean
TODO, tracked by #186765. Character and derived-type allocatable reductions do
lower.

Fixes #207255.
Fixes #207489.

An imported reduction is materialized lazily. Its `omp.declare_reduction` op is
created on demand, only when a reduction clause has resolved the exact reduction
it references, through the same lowering path a local declare reduction uses.
There is no separate eager pass that walks accessible scopes to pre-create ops.

    [55 lines not shown]
DeltaFile
+296-75flang/lib/Lower/Support/ReductionProcessor.cpp
+219-45flang/lib/Lower/OpenMP/OpenMP.cpp
+235-0flang/lib/Semantics/openmp-utils.cpp
+205-0flang/test/Semantics/OpenMP/declare-reduction-ambiguous.f90
+62-130flang/lib/Semantics/check-omp-structure.cpp
+169-0flang/test/Lower/OpenMP/declare-reduction-special-separate-reexport.f90
+1,186-25059 files not shown
+3,454-43365 files

LLVM/project 2705d0allvm/lib/Target/AMDGPU AMDGPU.td

[AMDGPU] Limit unclaused VMEM w/a to specific targets

Fixes: LCOMPILER-2448
DeltaFile
+9-4llvm/lib/Target/AMDGPU/AMDGPU.td
+9-41 files

LLVM/project 7cef6a7llvm/include/llvm/ADT GenericCycleImpl.h GenericCycleInfo.h

[CycleInfo] Number cycles and move the exit-block cache to GenericCycleInfo. NFC

Assign each cycle a preorder ID in layoutBlocks's Euler-tour walk and
move the caches into a lazily allocated table indexed by ID, shrinking
sizeof(GenericCycle) from 128 to 80. appendEntry/setSingleEntry no
longer invalidate: the exit-block set does not depend on entries. Delete
the unused GenericCycle::clear.

Aided by Claude Fable 5

Pull Request: https://github.com/llvm/llvm-project/pull/209666
DeltaFile
+19-12llvm/include/llvm/ADT/GenericCycleImpl.h
+10-21llvm/include/llvm/ADT/GenericCycleInfo.h
+29-332 files

LLVM/project f2c105allvm/lib/Target/AMDGPU AMDGPUSwLowerLDS.cpp, llvm/test/CodeGen/AMDGPU amdgpu-sw-lower-lds-flat-ptr-arg-asan.ll

[AMDGPU] Fix LDS access via flat pointer argument in amdgpu-sw-lower-lds
DeltaFile
+82-0llvm/lib/Target/AMDGPU/AMDGPUSwLowerLDS.cpp
+73-0llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-flat-ptr-arg-asan.ll
+155-02 files

LLVM/project 521d3e3llvm/lib/Target/BPF BPFCheckAndAdjustIR.cpp, llvm/test/CodeGen/BPF sink-min-max.ll

[BPF][ProfCheck] Fix sink-min-max.ll

In bpf-check-and-opt-ir, llvm.umax and llvm.umin are lowered into
explicit comparisons/i1 bitwise operations involving select. Make sure
to mark the selects as having an explicitly unknown profile given we
cannot infer what is likely/unlikely to avoid profcheck failures.

Reviewers: yonghong-song, mtrofin, eddyz87

Pull Request: https://github.com/llvm/llvm-project/pull/209682
DeltaFile
+12-6llvm/test/CodeGen/BPF/sink-min-max.ll
+4-0llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
+0-1llvm/utils/profcheck-xfail.txt
+16-73 files

LLVM/project c102184lld/ELF SyntheticSections.cpp Writer.cpp, lld/test/ELF local-symbols-order.s relocatable-gc.s

[ELF] Synthesize STT_FILE if necessary (#209087)

lld groups local symbols in .symtab by input file, appending a symbol
converted to STB_LOCAL (hidden visibility, version script `local:`, or
--exclude-libs) to its file's group. The nearest preceding STT_FILE then
claims the symbol, but the attribution can be wrong: the file may
contain multiple STT_FILE symbols (-r output), or lack an STT_FILE for
the symbol's unit.

```
FILE    LOCAL  DEFAULT   ABS a.c
NOTYPE  LOCAL  DEFAULT     7 a_local
FILE    LOCAL  DEFAULT   ABS b.c
NOTYPE  LOCAL  DEFAULT     7 b_local
NOTYPE  LOCAL  DEFAULT     7 a_localized
```

Follow GNU ld:


    [14 lines not shown]
DeltaFile
+137-29lld/test/ELF/local-symbols-order.s
+45-22lld/ELF/SyntheticSections.cpp
+14-13lld/test/ELF/relocatable-gc.s
+21-2lld/ELF/Writer.cpp
+4-9lld/test/ELF/ppc64-local-entry.s
+11-1lld/test/ELF/strtab-nodedup.s
+232-766 files not shown
+262-8512 files

LLVM/project e107211clang/test/AST/HLSL Textures-vector-AST.hlsl Textures-scalar-AST.hlsl, flang/test/Semantics conditional-arg.f90

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+3,622-0mlir/lib/Dialect/OpenACC/Transforms/ACCCGToGPU.cpp
+732-732llvm/test/MC/RISCV/corev/XCVsimd-invalid.s
+590-590llvm/test/CodeGen/X86/vector-interleaved-store-i16-stride-6.ll
+1,060-19flang/test/Semantics/conditional-arg.f90
+932-0clang/test/AST/HLSL/Textures-vector-AST.hlsl
+932-0clang/test/AST/HLSL/Textures-scalar-AST.hlsl
+7,868-1,3412,695 files not shown
+32,218-17,6052,701 files

LLVM/project 15cd911llvm/test/CodeGen/BPF sink-min-max.ll

[BPF] Use UTC for sink-min-max.ll

The assertions were providing a similar level of coverage. Autogenerate
them to make maintenance easier.

Reviewers: mtrofin, yonghong-song, eddyz87

Pull Request: https://github.com/llvm/llvm-project/pull/209681
DeltaFile
+138-116llvm/test/CodeGen/BPF/sink-min-max.ll
+138-1161 files

LLVM/project dccdaccmlir/include/mlir/Dialect/Arith/IR ArithOps.td, mlir/lib/Dialect/Arith/IR ArithCanonicalization.td ArithOps.cpp

[mlir][arith] Canonicalize `addf(negf(x), y)` to `subf(y, x)` (#209277)

`arith.addf` had no canonicalization patterns at all. This adds a
canonicalizer rewriting `addf(negf(x), y) -> subf(y, x)` (and the
commuted operand order).

The rewrite is valid under any rounding mode, which is propagated to the
`subf`: `negf` is an exact sign flip, IEEE addition is commutative, and
`y - x` is the correctly rounded `y + (-x)`, so `subf(y, x)` and
`addf(negf(x), y)` are bit-identical for every rounding mode. Fast-math
flags are propagated to the new `subf`.

----

Code partially generated with Claude Code.

Signed-off-by: Víctor Pérez Carrasco <victorperez at fb.com>
Co-authored-by: Víctor Pérez Carrasco <victorperez at fb.com>
DeltaFile
+59-0mlir/test/Dialect/Arith/canonicalize.mlir
+18-0mlir/lib/Dialect/Arith/IR/ArithCanonicalization.td
+5-0mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+1-0mlir/include/mlir/Dialect/Arith/IR/ArithOps.td
+83-04 files

LLVM/project f4120c4libcxx/include __bit_reference, libcxx/test/libcxx/algorithms/alg.nonmodifying/alg.foreach assert.ranges.for_each_n.pass.cpp assert.for_each_n.pass.cpp

[libc++] Treat negative counts in copy_n & friends as no-ops (#207086)

The standard specifies copy_n, fill_n and generate_n (both std and
ranges) to be no-ops when passed a negative count. This patch fixes
libc++ to abide by that requirement, with tests.

It's worth noting that std::for_each_n makes n > 0 a precondition
instead: we add the check and tests for it.

Fixes #193613
DeltaFile
+69-0libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp
+37-0libcxx/test/libcxx/algorithms/alg.nonmodifying/alg.foreach/assert.ranges.for_each_n.pass.cpp
+33-0libcxx/test/libcxx/algorithms/alg.nonmodifying/alg.foreach/assert.for_each_n.pass.cpp
+18-0libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_n.pass.cpp
+9-8libcxx/include/__bit_reference
+17-0libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
+183-87 files not shown
+239-2413 files

LLVM/project 0a933belibcxx/test/benchmarks/algorithms/sorting equal_range.bench.cpp binary_search.bench.cpp

[libc++] Add benchmarks for std::binary_search and std::equal_range (#207268)

The found and not-found paths are measured as separate benchmarks. For
equal_range we additionally cover a unique match, a large equal range,
and an absent key.

As a drive-by, add a predicate variation to the existing lower_bound and
upper_bound benchmarks.
DeltaFile
+133-0libcxx/test/benchmarks/algorithms/sorting/equal_range.bench.cpp
+121-0libcxx/test/benchmarks/algorithms/sorting/binary_search.bench.cpp
+55-55libcxx/test/benchmarks/algorithms/sorting/lower_upper_bound.bench.cpp
+309-553 files

LLVM/project a16f3a0libcxx/test/benchmarks/algorithms/modifying replace_copy.bench.cpp

[libc++] Add benchmarks for std::replace_copy and std::replace_copy_if (#207070)

Assisted by Claude
DeltaFile
+121-0libcxx/test/benchmarks/algorithms/modifying/replace_copy.bench.cpp
+121-01 files

LLVM/project d55259allvm/include/llvm/ADT GenericCycleImpl.h GenericCycleInfo.h, llvm/include/llvm/CodeGen MachineCycleAnalysis.h

[CycleInfo] Move representation-dependent queries to GenericCycleInfo. NFC

With the Euler tour representation (#208614), blocks live in
GenericCycleInfo::BlockLayout and GenericCycle keeps a `CI` back-pointer just
so the out-of-line contains(BlockT *) and blocks() can reach it.

Adopt the design suggested by @aengelke, move the
representation-dependent queries to GenericCycleInfo, taking the cycle
as an argument (contains, getBlocks, getExitBlocks, getExitingBlocks,
getCyclePreheader, getCyclePredecessor, verifyCycle, verifyCycleNest,
and per-cycle print), and delete GenericCycle::CI.

- GenericCycleInfo's move operations become defaulted, dropping the
  CI re-pointing walk, and sizeof(GenericCycle) shrinks by a pointer.
- isCycleInvariant gains a MachineCycleInfo parameter, and
  GenericUniformityInfo gains getCycleInfo() for callers that only hold the
  uniformity result.

Aided by Claude Fable 5

Pull Request: https://github.com/llvm/llvm-project/pull/209665
DeltaFile
+69-117llvm/include/llvm/ADT/GenericCycleImpl.h
+75-85llvm/include/llvm/ADT/GenericCycleInfo.h
+46-35llvm/include/llvm/ADT/GenericUniformityImpl.h
+11-11llvm/lib/Transforms/Utils/FixIrreducible.cpp
+4-4llvm/lib/CodeGen/MachineSink.cpp
+4-3llvm/include/llvm/CodeGen/MachineCycleAnalysis.h
+209-2559 files not shown
+227-26815 files

LLVM/project d50be15clang/test/OpenMP teams_distribute_parallel_for_simd_if_openmp52_codegen.cpp target_teams_distribute_parallel_for_simd_if_openmp52_codegen.cpp, llvm/test/CodeGen/AMDGPU/GlobalISel legalize-llvm.amdgcn.image.sample.a16.ll legalize-store-global.mir

Rebase

Created using spr 1.3.7
DeltaFile
+23,904-12llvm/test/CodeGen/RISCV/clmul.ll
+6,603-5,923llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll
+12,190-0clang/test/OpenMP/teams_distribute_parallel_for_simd_if_openmp52_codegen.cpp
+12,098-0clang/test/OpenMP/target_teams_distribute_parallel_for_simd_if_openmp52_codegen.cpp
+4,743-4,743llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-store-global.mir
+4,076-4,028llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.dim.a16.ll
+63,614-14,7069,101 files not shown
+380,867-255,4839,107 files

LLVM/project 0639fe1llvm/lib/Target/X86 X86ISelLowering.cpp

[X86] combineINSERT_SUBVECTOR - use peekThroughBitcastsAndExtracts helper to match target shuffles as well. NFC. (#209803)

We were always checking if the result of peekThroughBitcastsAndExtracts
was a target shuffle - so let the helper do it for us.

Makes it easier for future handling of faux shuffles as well.
DeltaFile
+4-8llvm/lib/Target/X86/X86ISelLowering.cpp
+4-81 files

LLVM/project 547e9d0openmp/runtime/src kmp_barrier.cpp

[OpenMP] Fix endian bug in hierarchical barrier code (#117073)

The "oncore" flavor of the hierarchical barrier code uses a single
uint64 to hold both a barrier state *and* a set of flags for the current
node's "leaf kids" in the tree.

To make this work, the barrier state is placed in the least-significant
byte of the uint64, and the flags for leaf kids are placed in other
bytes of the uint64 starting from the most-significant byte to represent
the first child.

At least, this is how it works on little-endian systems. On big-endian
hosts, the current code unfortunately places the leaf kid flags starting
from the *least* significant byte of the uint64, where they will overlap
and clobber the barrier state byte, resulting in corrupted barrier
behavior.

To fix this, this PR changes the child flag offsets to always start with
the MSB, on both big- and little- endian hosts. This was complicated a

    [19 lines not shown]
DeltaFile
+23-8openmp/runtime/src/kmp_barrier.cpp
+23-81 files

LLVM/project 0cf914alibcxx/cmake/caches Generic-llvm-libc.cmake, libcxx/test/libcxx/thread/thread.threads/thread.thread.class/thread.thread.member native_handle.pass.cpp

[libcxx][libc] update LLVM-libc test status (#201236)

This update removes some unnecessary carveouts, marks some newly
XFAILing tests, and unmarks some now passing tests.

With this change the status of tests is:
Total Discovered Tests: 11471
  Unsupported      : 2098 (18.29%)
  Passed           : 9260 (80.73%)
  Expectedly Failed:  113 (0.99%)

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+2-11libcxx/cmake/caches/Generic-llvm-libc.cmake
+3-0libcxx/test/libcxx/thread/thread.threads/thread.thread.class/thread.thread.member/native_handle.pass.cpp
+3-0libcxx/test/std/depr/depr.c.headers/wchar_h.compile.pass.cpp
+3-0libcxx/test/std/depr/depr.c.headers/wctype_h.compile.pass.cpp
+3-0libcxx/test/std/strings/c.strings/cwchar.pass.cpp
+3-0libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.bin/io.pass.cpp
+17-1115 files not shown
+39-3121 files