LLVM/project fe3f16a — clang/docs/CIR/_raw PostProcessCIRDocs.py, llvm/lib/ObjectYAML BBAddrMapYAML.cpp

Merge branch 'main' into users/chinmaydd/amdgpu-sramecc-subtarget-key
DeltaFile
+146-307llvm/test/CodeGen/NVPTX/mulwide.ll
+30-138llvm/test/CodeGen/AMDGPU/hard-clauses-gfx1250.mir
+6-116llvm/tools/obj2yaml/elf2yaml.cpp
+121-0llvm/lib/ObjectYAML/BBAddrMapYAML.cpp
+54-53llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
+72-19clang/docs/CIR/_raw/PostProcessCIRDocs.py
+429-633144 files not shown
+1,667-1,246150 files

LLVM/project 90a3063 — llvm/lib/Analysis ValueTracking.cpp, llvm/test/Transforms/InstCombine fpclass-from-dom-cond.ll

[ValueTracking] Require full nan/inf masks when propagating FMA class exclusions (#232675)

Fixes https://github.com/llvm/llvm-project/issues/232565, which is
introduced by https://github.com/llvm/llvm-project/pull/175999.
`KnownNotFromFlags & fcInf` is nonzero even when only one infinity class
is excluded. Require `(KnownNotFromFlags & fcInf) == fcInf` to exclude
both +inf and -inf. Same for nan.
DeltaFile
+26-0llvm/test/Transforms/InstCombine/fpclass-from-dom-cond.ll
+4-4llvm/lib/Analysis/ValueTracking.cpp
+30-42 files

LLVM/project 383ff59 — libc/src/__support/OSUtil/linux/syscall_wrappers CMakeLists.txt getcpu.h, libc/src/sched/linux CMakeLists.txt sched_getcpu.cpp

[libc] Use a syscall wrapper for sched_getcpu
DeltaFile
+38-0libc/src/__support/OSUtil/linux/syscall_wrappers/getcpu.h
+28-0utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+12-0libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
+4-7libc/src/sched/linux/sched_getcpu.cpp
+4-1libc/src/sched/linux/CMakeLists.txt
+86-85 files

LLVM/project 55180e5 — .github/workflows libcxx-lnt-pipeline.yml libcxx-lnt-pipeline-libstdcxx.yml

[libc++] Properly pass the LNT submission token to the submit workflow (#233010)

Reusable worklows don't automatically get their environment secrets
passed, they need to declare them and their callers to pass them
explicitly.
DeltaFile
+4-0.github/workflows/libcxx-lnt-submit.yml
+2-0.github/workflows/libcxx-lnt-pipeline.yml
+2-0.github/workflows/libcxx-lnt-pipeline-libstdcxx.yml
+8-03 files

LLVM/project 5b79bc4 — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/lib/Transforms/Vectorize/SLPVectorizer SLPMemoryUtils.cpp

[SLP] Handle REVEC when costing expanded compress mask

With REVEC the scalars are vectors. The masked-load-compress shuffle that is
emitted uses the compress mask expanded to the elements of those vectors
(transformScalarShuffleIndiciesToVector), but the cost was computed with the
unexpanded per-vector mask, so a shuffle such as <24 x i8> -> <16 x i8> was
costed as a <2 x i8> shuffle. This made the compress sequence looked cheaper
than it is.

Assisted-By: Claude Sonnet 5.5
DeltaFile
+13-9llvm/test/Transforms/SLPVectorizer/RISCV/revec-compress-mask-cost.ll
+7-2llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+6-2llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPMemoryUtils.cpp
+26-133 files

LLVM/project 58db2aa — mlir/lib/Transforms/Utils GreedyPatternRewriteDriver.cpp

[mlir] Check greedy rewrite fingerprints and changed flag (#232576)

Under EXPENSIVE_CHECKS, compare operation fingerprints before and after
greedy rewriting. If the IR changes but the driver reports no change,
emit a fatal error.

Assisted-by: gpt 6.1 sol
DeltaFile
+31-2mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
+31-21 files

LLVM/project b58f8b4 — libc/src/__support/OSUtil/linux/syscall_wrappers CMakeLists.txt getcpu.h, libc/src/sched/linux CMakeLists.txt sched_getcpu.cpp

[libc] Use a syscall wrapper for sched_getcpu
DeltaFile
+37-0libc/src/__support/OSUtil/linux/syscall_wrappers/getcpu.h
+28-0utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+12-0libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
+4-7libc/src/sched/linux/sched_getcpu.cpp
+4-1libc/src/sched/linux/CMakeLists.txt
+85-85 files

LLVM/project 7f658fb — llvm/lib/Transforms/InstCombine InstCombineAtomicRMW.cpp, llvm/test/Transforms/InstCombine atomicrmw-add-neg.ll

Support vector
DeltaFile
+4-3llvm/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp
+3-3llvm/test/Transforms/InstCombine/atomicrmw-add-neg.ll
+7-62 files

LLVM/project 075886b — clang/test/CodeGen ms-intrinsics-other.c ms-intrinsics.c

Fix clang lit test
DeltaFile
+12-12clang/test/CodeGen/ms-intrinsics.c
+4-4clang/test/CodeGen/ms-intrinsics-other.c
+16-162 files

LLVM/project 88487fb — llvm/lib/Transforms/InstCombine InstCombineAtomicRMW.cpp, llvm/test/Transforms/InstCombine atomicrmw-add-neg.ll

[InstCombine] Canonicalize atomicrmw sub of a constant to add

Rewrite `atomicrmw sub ptr, C` as `atomicrmw add ptr, -C`. This
matches the canonical form InstCombine already uses for plain `sub`.
In wrapping arithmetic $old - C = old + (-C)$, so both the stored
value and the returned old value stay the same, including when C is
`INT_MIN`. Ordering, syncscope and metadata are kept.

```llvm
; before
%old = atomicrmw sub ptr %p, i32 1 syncscope("agent") monotonic
; after
%old = atomicrmw add ptr %p, i32 -1 syncscope("agent") monotonic
```
This benefits AMDGPU, for example: https://godbolt.org/z/39xsYro3o
DeltaFile
+7-0llvm/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp
+2-2llvm/test/Transforms/InstCombine/atomicrmw-add-neg.ll
+9-22 files

LLVM/project a5df646 — llvm/test/Transforms/InstCombine atomicrmw-add-neg.ll

Add vector test
DeltaFile
+30-0llvm/test/Transforms/InstCombine/atomicrmw-add-neg.ll
+30-01 files

LLVM/project 08b8038 — clang/lib/CIR/Dialect/Transforms CXXABILowering.cpp, clang/test/CIR/Transforms cxx-abi-lowering-member-record.cir cxx-abi-lowering-same-type-cast-fold.cir

[CIR] Skip record rebuilds for unchanging types in CXXABI lowering (#232880)

CIRABITypeConverter only rewrites data-member and method types, but it
did not override typeMayChange, so every named record converted to a
renamed copy and every op touching one was illegal, forcing the generic
pattern to rebuild them all. Override it to report only those two types
as possibly changing, letting records that reach neither convert to
themselves and stay legal.

Small gains across the more expensive selfhosting TUs (no CIR output
changes):
- Registry 36.7->35.8,
- ASTImporterTest 64.4->63.7,
- SLPVectorizer 93.6->91.9,
- OpenMPDecomp 39.5->38.1, 
- SemaExpr 59.3->57.5.
DeltaFile
+45-0clang/test/CIR/Transforms/cxx-abi-lowering-same-type-cast-fold.cir
+28-0clang/lib/CIR/Dialect/Transforms/CXXABILowering.cpp
+26-0clang/test/CIR/Transforms/cxx-abi-lowering-member-record.cir
+99-03 files

LLVM/project 67f7c59 — flang/include/flang/Semantics openmp-utils.h, flang/lib/Lower/OpenMP OpenMP.cpp

[flang][OpenMP] Don't drop NOTHING with clauses in METADIRECTIVE

A METADIRECTIVE replacement of NOTHING was treated as having no
directive, even when it had clauses. A selected `nothing apply(...)` was
therefore lowered as a no-op, silently dropping the loop transformation.

Keep NOTHING as a replacement when it has clauses, and report it as not
yet implemented in lowering.

Assisted-by: GitHub Copilot (Claude Opus 5.5)
DeltaFile
+12-11flang/lib/Semantics/openmp-utils.cpp
+23-0flang/test/Lower/OpenMP/Todo/metadirective-nothing-apply.f90
+2-2flang/include/flang/Semantics/openmp-utils.h
+2-0flang/lib/Lower/OpenMP/OpenMP.cpp
+39-134 files

LLVM/project bf64404 — llvm/include/llvm/Target TargetMacroFusion.td, llvm/test/TableGen MacroFusion.td

[TableGen] Mark Macro Fusion Features as Inline Ignore (#232889)

Tuning features are conventionally inline ignore -- you tune the whole
function according to the caller rather than merging caller/callee
tuning features.

Macro Fusion features are a kind of tuning feature, and until now were
marked InlineDefault - with this change they should be ignored and
therefore not prevent inlining.

Assisted-by: AI (for Tests)
DeltaFile
+14-0llvm/test/TableGen/MacroFusion.td
+2-0llvm/include/llvm/Target/TargetMacroFusion.td
+16-02 files

LLVM/project cad1dc5 — llvm/test/Transforms/InstCombine atomicrmw-add-neg.ll

[InstCombine] Add tests for atomicrmw sub of a constant. NFC

atomicrmw sub C can be canonicalized to atomicrmw add -C because both
produce the same stored and returned values under wrapping arithmetic.
Cover syncscope, INT_MIN, and negative cases.
DeltaFile
+44-0llvm/test/Transforms/InstCombine/atomicrmw-add-neg.ll
+44-01 files

LLVM/project 7fbbf41 — utils/bazel/llvm-project-overlay/llvm/unittests BUILD.bazel

[Bazel] Fixes 372a4c3 (#233000)

This fixes 372a4c35991023298bbb35d3371f9010656fa176 (#232599).

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

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

LLVM/project 8333e5e — llvm/lib/Target/LoongArch LoongArchLASXInstrInfo.td, llvm/test/CodeGen/LoongArch llvm.exp10.ll llvm.sincos.ll

[LoongArch] Extract FP vector element 0 as a subregister

Element 0 of an LSX/LASX floating-point vector is the aliased FPR, so
extractelement with index 0 needs no [x]vreplvei/xvpickve.
DeltaFile
+62-68llvm/test/CodeGen/LoongArch/llvm.sincos.ll
+35-39llvm/test/CodeGen/LoongArch/lsx/ir-instruction/flog2.ll
+34-36llvm/test/CodeGen/LoongArch/lsx/fpowi.ll
+6-6llvm/test/CodeGen/LoongArch/llvm.exp10.ll
+9-0llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
+2-5llvm/test/CodeGen/LoongArch/lsx/extract-fp-elt0.ll
+148-1545 files not shown
+157-16811 files

LLVM/project 749454c — llvm/test/CodeGen/LoongArch/lasx extract-fp-elt0.ll, llvm/test/CodeGen/LoongArch/lsx extract-fp-elt0.ll

[LoongArch][NFC] Pre-commit tests for extracting FP vector element 0
DeltaFile
+61-0llvm/test/CodeGen/LoongArch/lsx/extract-fp-elt0.ll
+61-0llvm/test/CodeGen/LoongArch/lasx/extract-fp-elt0.ll
+122-02 files

LLVM/project 97f7708 — flang/test/Driver bbc-openmp-target-context.f90, flang/tools/bbc bbc.cpp

[flang] Set the target in bbc's semantics context

bbc created a target machine but never passed its triple and features to
the semantics context. Without a target triple, semantics treats device
and implementation context selectors as possibly matching, so it
checked METADIRECTIVE replacements that can never be selected for the
target. For example, bbc reported a COLLAPSE error for the SIMD
replacement of when(device={arch(nvptx64)}: simd collapse(2)) on
x86-64, while flang accepts it.

Set the semantics target triple and features from the target machine, as
the flang driver does.

Assisted-by: GitHub Copilot (Claude Opus 5.5)
DeltaFile
+20-0flang/test/Driver/bbc-openmp-target-context.f90
+2-0flang/tools/bbc/bbc.cpp
+22-02 files

LLVM/project 372a4c3 — clang/lib/CodeGen BackendUtil.cpp, llvm/include/llvm/CGData CodeGenData.h

[Option] Make Passes, Scalar, Instrumentation, and CGData options per-context (#232599)

Follow-up to #232365: drop `perContext = false` from PassesOptions,
ScalarOptions, InstrumentationOptions, and CGDataOptions.

* IR passes read their LLVMContext's options in run(). Legacy passes
  that chose analyses from an option now always require them
  (ConstantHoisting, StructurizeCFG, GVN).
* Pass parameters that an option overrides are combined in run(), so
  -print-pipeline-passes no longer folds such options (e.g.
  -bonus-inst-threshold) into the printed parameters.
* PipelineTuningOptions carries the library options to PassBuilder,
  which falls back to the TargetMachine's. opt, clang, flang, and Polly
  pass their module's.
* The CodeGenData singleton is configured by its first caller's context.
  lld and llvm-cgdata pass an empty context, which reads the global
  values their -mllvm sets.

LLM-aided
DeltaFile
+54-53llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
+38-44llvm/lib/Passes/StandardInstrumentations.cpp
+40-38llvm/lib/Transforms/Scalar/LICM.cpp
+28-42llvm/lib/Transforms/Scalar/GVN.cpp
+35-18llvm/include/llvm/CGData/CodeGenData.h
+29-19clang/lib/CodeGen/BackendUtil.cpp
+224-214108 files not shown
+899-613114 files

LLVM/project dc4ed10 — flang/lib/Lower/OpenMP OpenMP.cpp Utils.cpp, flang/test/Lower/OpenMP declare-variant-construct.f90 variant-source-context.f90

[flang][OpenMP] Match variant selectors in the source construct context

The construct context for METADIRECTIVE and DECLARE VARIANT came from
enclosing MLIR operations. It recognized only a few operations, followed
operation nesting instead of source nesting, kept constructs outside an
enclosing TARGET, and used the body context for clause expressions and
loop bounds.

Build the context from the evaluation's source ancestors and from frames
for construct regions entered during lowering:
- A selected METADIRECTIVE replacement stands in for its source construct.
- TARGET discards the outer context.
- Constructs without a selector property still add a nesting level.
- Clause expressions see only enclosing constructs.
- Loop bounds see the leaves that precede the first loop-associated leaf.
- Specification expressions see no construct.

Add llvm::omp::getConstructTraits, which returns the construct traits a
directive adds in source order, with an invalid placeholder for a

    [14 lines not shown]
DeltaFile
+580-0flang/test/Lower/OpenMP/declare-variant-loop-bounds.f90
+303-0flang/test/Lower/OpenMP/declare-variant-metadirective-context.f90
+211-0flang/test/Lower/OpenMP/variant-source-context.f90
+111-2flang/test/Lower/OpenMP/declare-variant-construct.f90
+86-22flang/lib/Lower/OpenMP/Utils.cpp
+71-18flang/lib/Lower/OpenMP/OpenMP.cpp
+1,362-4216 files not shown
+1,759-5622 files

LLVM/project 5a9da12 — clang-tools-extra/clangd/unittests FindTargetTests.cpp, clang/include/clang/AST RecursiveASTVisitor.h

[clang] Fix incorrect PackIndexingTypeLoc traversal in RecursiveASTVisitor (#231191)

Fixes [clangd/clangd#2713](https://github.com/clangd/clangd/issues/2713)

Assisted-by: Claude
DeltaFile
+20-0clang/unittests/AST/SourceLocationTest.cpp
+9-0clang-tools-extra/clangd/unittests/FindTargetTests.cpp
+1-1clang/include/clang/AST/RecursiveASTVisitor.h
+30-13 files

LLVM/project c9ab784 — clang/docs/CIR/_raw PostProcessCIRDocs.py, clang/include/clang/CIR/Dialect CMakeLists.txt

[CIR][Docs][www] Generate and publish the CIR dialect reference docs (#232912)

Wire up a consolidated CIR dialect reference page: the existing
-gen-dialect-doc output (operations, types, attributes, enums) plus a
passes section generated from Passes.td (-gen-pass-doc), merged ahead of
the other sections with an explicit index of the page sections.

The landing page grows a "CIR Dialect Reference" section right after
"Using ClangIR", showing an index into the reference page.

Also fix the doc tablegen include roots: the `MLIR_*_INCLUDE_DIR`
variables are still empty when Clang configures (MLIR configures later),
so derive the same roots from LLVM dirs instead; without this the
tablegen cannot find `mlir/*.td`.
DeltaFile
+72-19clang/docs/CIR/_raw/PostProcessCIRDocs.py
+7-1clang/include/clang/CIR/Dialect/CMakeLists.txt
+79-202 files

LLVM/project 6432929 — clang/include/clang/Sema Sema.h, clang/lib/Parse ParseDecl.cpp

[BoundsSafety] Don't orphan a shared counted_by node when one declarator nests it

A late-parsed counted_by-family attribute in declaration-specifier position is
shared by every declarator in the declaration, so they share one incomplete
CountAttributedType. When one declarator nests the node, as `*b` does in
`IP __counted_by(n) a, *b;`, it is rejected and the node is marked rejected.
The completion pass then skipped the node for every declarator, so `a` kept a
CountAttributedType without a count and crashed on use in
FieldDecl::findCountedByField.

Make the rejection apply to the declarator only. The parser checks and clears
the mark after each declarator, and doesn't pair a rejected declarator's field
with the attribute. The completion pass skips an attribute with no fields left,
still without parsing its argument.

Assisted-by: Opus 5.5
DeltaFile
+32-0clang/test/Sema/attr-counted-by-late-parsed-regressions.c
+17-6clang/lib/Parse/ParseDecl.cpp
+8-6clang/include/clang/Sema/Sema.h
+57-123 files

LLVM/project e7a79e3 — clang/include/clang/Parse Parser.h, clang/lib/Sema SemaBoundsSafety.cpp SemaType.cpp

Address review #8
DeltaFile
+60-0clang/test/Sema/attr-counted-by-multiple-on-pointer.c
+41-0clang/test/PCH/attr-counted-by-late-parsed-parse-error.c
+32-0clang/test/Sema/attr-counted-by-late-parsed-rejected-once.c
+14-13clang/lib/Sema/SemaType.cpp
+11-0clang/lib/Sema/SemaBoundsSafety.cpp
+7-1clang/include/clang/Parse/Parser.h
+165-143 files not shown
+177-199 files

LLVM/project e4d7bb4 — clang/test/Modules bounds-safety-attributed-type-late-parsed.c, clang/test/PCH bounds-safety-attributed-type-late-parsed.c

[BoundsSafety][test] Add late-parsed counted_by type-attribute coverage

New tests exercising the late-parse fill-in mechanism:
  - Sema/attr-counted-by-weird-type-positions{,-late-parsed}.c: counted_by
    in assorted type positions, nested pointers, and rejection cases.
  - Sema/attr-bounds-safety-function-ptr-param.c: attributes on
    function-pointer-typed members.
  - Modules/ and PCH/ bounds-safety-attributed-type-late-parsed: the
    resolved type round-trips through serialization.

  - Sema/attr-counted-by-late-parsed-regressions.c: guards against the
    double-free on a nested-record decl-spec attribute and the null-count
    escape on a free-function parameter.
DeltaFile
+456-0clang/test/Sema/attr-counted-by-weird-type-positions-late-parsed.c
+454-0clang/test/Sema/attr-counted-by-weird-type-positions.c
+173-0clang/test/Sema/attr-bounds-safety-function-ptr-param.c
+111-0clang/test/Modules/bounds-safety-attributed-type-late-parsed.c
+104-0clang/test/Sema/attr-counted-by-late-parsed-regressions.c
+69-0clang/test/PCH/bounds-safety-attributed-type-late-parsed.c
+1,367-04 files not shown
+1,517-010 files

LLVM/project 5799d3f — clang/lib/Parse ParseDecl.cpp

Attach RecoveryExpr for invalid count argument
DeltaFile
+21-6clang/lib/Parse/ParseDecl.cpp
+21-61 files

LLVM/project 3abaa75 — clang/include/clang/Basic DiagnosticSemaKinds.td, clang/lib/Sema SemaType.cpp

Properly reject attributes on a function return type
DeltaFile
+55-0clang/test/Sema/attr-counted-by-return-type.c
+42-4clang/lib/Sema/SemaType.cpp
+2-0clang/include/clang/Basic/DiagnosticSemaKinds.td
+99-43 files

LLVM/project bd92501 — clang/lib/Parse ParseDecl.cpp, clang/test/Sema attr-counted-by-late-parsed-anon-stmt-expr.c

Address review 3
DeltaFile
+29-0clang/test/Sema/attr-counted-by-late-parsed-anon-stmt-expr.c
+7-1clang/lib/Parse/ParseDecl.cpp
+36-12 files

LLVM/project 77a58d1 — clang/test/Sema attr-counted-by-late-parsed-block-pointer.c attr-counted-by-late-parsed-non-member.c

Add some tests
DeltaFile
+42-0clang/test/Sema/attr-counted-by-late-parsed-non-member.c
+36-0clang/test/Sema/attr-counted-by-late-parsed-block-pointer.c
+78-02 files