LLVM/project 5517668clang-tools-extra/clang-tidy/readability RedundantZeroInitializerCheck.h RedundantZeroInitializerCheck.cpp, clang-tools-extra/docs ReleaseNotes.md

[clang-tidy] Add `readability-redundant-zero-initializer` (#209367)

Add a check that finds explicit single-element zero initializers of
arrays and rewrites them to empty braces, e.g. `char a[12] = {0};`
becomes `char a[12] = {};`. Empty-brace initialization zero-initializes
every element, so the explicit `{0}` is redundant. The check is only
enabled in C++ and in C23 or later.

The check is conservative and only rewrites a single-element `{0}` list
whose sole element is the integer literal `0` and whose array has an
explicit bound. It leaves alone, among others:
- arrays whose bound is deduced from the initializer (`char a[] = {0};`)
- multi-dimensional arrays (`int m[2][3] = {0};`)
- initializers with more than one element (`int a[3] = {0, 0};`);
- scalars and class/struct types
- zero written in another form such as `'\0'`, `0.0` or `nullptr`

Closes #209139


    [2 lines not shown]
DeltaFile
+138-0clang-tools-extra/test/clang-tidy/checkers/readability/redundant-zero-initializer.cpp
+65-0clang-tools-extra/clang-tidy/readability/RedundantZeroInitializerCheck.cpp
+38-0clang-tools-extra/clang-tidy/readability/RedundantZeroInitializerCheck.h
+36-0clang-tools-extra/docs/clang-tidy/checks/readability/redundant-zero-initializer.md
+16-0clang-tools-extra/test/clang-tidy/checkers/readability/redundant-zero-initializer.c
+6-0clang-tools-extra/docs/ReleaseNotes.md
+299-03 files not shown
+304-09 files

LLVM/project 8a6d4b8llvm/test/CodeGen/X86 extractsubvector-load.ll

[X86] extractsubvector-load.ll - basic test coverage for various extractsubvector(load) patterns (#216156)

Shows some poor codegen for non-aligned subvector indices

Basic frozen load test coverage for #216115
DeltaFile
+268-0llvm/test/CodeGen/X86/extractsubvector-load.ll
+268-01 files

LLVM/project 7a2437cclang/lib/CIR/CodeGen TargetInfo.h, clang/test/CIR/CodeGen record-member-kinds.c

[CIR] Address reviewer feedback

The comments on isEmptyFieldForABI and isEmptyRecordForABI were too verbose.  Adapt the comments on classic's isEmptyField and isEmptyRecord.

Add flexible array member tests.

Assisted-by: Cursor / claude-opus-5
DeltaFile
+8-19clang/lib/CIR/CodeGen/TargetInfo.h
+9-1clang/test/CIR/CodeGen/record-member-kinds.c
+17-202 files

LLVM/project 192399aclang/test/DebugInfo/Generic cc.c

[NFC][clang][DebugInfo] Add SPIR-V calling convention test coverage (#216095)
DeltaFile
+9-0clang/test/DebugInfo/Generic/cc.c
+9-01 files

LLVM/project 8e34eedclang/lib/StaticAnalyzer/Checkers ArrayBoundChecker.cpp

[NFC][analyzer] Clarify that ArrayBound only handles element regions (#216049)

The `security.ArrayBound` checker does not do anything when the value of
the expression that activated its callbacks isn't expressed as an
`ElementRegion`.

Previously this was a sneaky consequence of the logic in
`computeOffset`, but this commit highlights it with a straightforward
early return statement to ensure that the accessed element region is
available within the body of `ArrayBoundChecker::handleAccessExpr`.

(I intend to use this in a follow-up commit.)
DeltaFile
+13-13clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
+13-131 files

LLVM/project c2f1191llvm/test/CodeGen/X86 unaligned-32-byte-memops.ll

[X86] unaligned-32-byte-memops.ll - add common CHECK/AVX1 check prefixes (#216145)
DeltaFile
+35-77llvm/test/CodeGen/X86/unaligned-32-byte-memops.ll
+35-771 files

LLVM/project e72ba6cutils/bazel/llvm-project-overlay/mlir BUILD.bazel

[Bazel] Fixes e8ff1d1 (#216147)

This fixes e8ff1d1d93728ba488c8a09023c4554030463ced (#202315).

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

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

LLVM/project 4737387clang/include/clang/Basic AttrDocs.td, clang/test/CodeGen/LoongArch/lasx builtin-alias.c

Merge rm-toc
DeltaFile
+13,767-6,856llvm/test/tools/llvm-mca/AArch64/Cortex/C1Nano-sve-instructions.s
+6,347-3,146llvm/test/tools/llvm-mca/AArch64/Cortex/C1Nano-neon-instructions.s
+4,413-4,281clang/include/clang/Basic/AttrDocs.td
+5,067-2,506llvm/test/tools/llvm-mca/AArch64/Cortex/C1Nano-basic-instructions.s
+6,869-0llvm/test/tools/llvm-mca/AArch64/HiSilicon/hip12-sve-instructions.s
+2,728-2,728clang/test/CodeGen/LoongArch/lasx/builtin-alias.c
+39,191-19,5174,967 files not shown
+247,660-118,0744,973 files

LLVM/project 9492123clang/include/clang/Basic AttrDocs.td, clang/test/CodeGen/LoongArch/lasx builtin-alias.c

Merge main
DeltaFile
+13,767-6,856llvm/test/tools/llvm-mca/AArch64/Cortex/C1Nano-sve-instructions.s
+6,347-3,146llvm/test/tools/llvm-mca/AArch64/Cortex/C1Nano-neon-instructions.s
+4,413-4,281clang/include/clang/Basic/AttrDocs.td
+5,067-2,506llvm/test/tools/llvm-mca/AArch64/Cortex/C1Nano-basic-instructions.s
+6,869-0llvm/test/tools/llvm-mca/AArch64/HiSilicon/hip12-sve-instructions.s
+2,728-2,728clang/test/CodeGen/LoongArch/lasx/builtin-alias.c
+39,191-19,5174,967 files not shown
+247,660-118,0744,973 files

LLVM/project 389da87clang/include/clang/Basic AttrDocs.td

Document that the swiftcall and swiftasynccall attributes are ABI-unstable (#215915)

...except on platforms where the Swift projects has declared ABI
stability.
DeltaFile
+16-0clang/include/clang/Basic/AttrDocs.td
+16-01 files

LLVM/project e8ff1d1flang/test/Fir atomic-compare-capture.fir, flang/test/Integration/OpenMP atomic-compare-capture.f90

[flang][OpenMP] Support for "atomic compare capture" (#202315)

Adding support for "!$omp atomic compare capture".

This also Fixes [#202311](https://github.com/llvm/llvm-project/issues/202311)

Co-authored-by: Sunil Kuravinakop <koops at hpe.com>
DeltaFile
+678-182mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+492-0mlir/test/Target/LLVMIR/openmp-atomic-compare-capture.mlir
+449-0flang/test/Integration/OpenMP/atomic-compare-capture.f90
+426-8flang/test/Lower/OpenMP/atomic-compare.f90
+386-0flang/test/Lower/OpenMP/atomic-compare-capture.f90
+343-0flang/test/Fir/atomic-compare-capture.fir
+2,774-19014 files not shown
+3,749-31120 files

LLVM/project 31cfad3

Fix Bazel build for cb72195 (#216144)

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

Co-authored-by: Google Bazel Bot <google-bazel-bot at google.com>
DeltaFile
+0-00 files

LLVM/project 1caeb26clang/docs ItaniumMangleAbiTags.md HardwareAssistedAddressSanitizerDesign.md, clang/docs/CIR ABILowering.md

[clang][docs] Fix Markdown code fence languages

Use more precise lexer names for code fences in the Clang Markdown migration:
HLSL examples use hlsl, Itanium ABI grammar uses bnf, CIR snippets that are
valid MLIR use mlir, and HWASAN assembly-style listings use objdump.

Keep plain text fences for bytecode dumps, AST dumps, diagrams, pseudocode, and
CIR snippets that contain placeholders rejected by the MLIR lexer.
DeltaFile
+9-9clang/docs/HLSL/FunctionCalls.md
+2-3clang/docs/HLSL/ExpectedDifferences.md
+2-3clang/docs/HLSL/AvailabilityDiagnostics.md
+2-2clang/docs/ItaniumMangleAbiTags.md
+2-2clang/docs/HardwareAssistedAddressSanitizerDesign.md
+2-2clang/docs/CIR/ABILowering.md
+19-216 files

LLVM/project 98d84e3llvm/lib/Target/AMDGPU AMDGPULegalizerInfo.cpp, llvm/test/CodeGen/AMDGPU/GlobalISel mul-known-bits.i128.ll

[AMDGPU][GlobalISel] Fix wide multiply with known-zero parts (#215356)

Materialize a zero accumulator when all partial products for a
destination part are skipped, avoiding an invalid null register during
legalization.
DeltaFile
+49-0llvm/test/CodeGen/AMDGPU/GlobalISel/mul-known-bits.i128.ll
+11-0llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+60-02 files

LLVM/project 199678bopenmp/runtime/src ompt-event-specific.h

[OpenMP][OMPT] Mark dispatch callback as sometimes on registration (#212991)

Recently, multiple issues in the implementation of the `dispatch`
callback have been found (e.g., #212784, #207746). In these, the code
generation done by Clang and Flang does not provide a sufficient amount
of information for the runtime to dispatch the correct amount of flags,
or a callback for a given event at all.

These missing and incorrect events do not satisfy OpenMP's requirement
for `ompt_set_always` as a registration result, as the runtime does not
trace or invoke the correct callback whenever an associated event occurs
(OpenMP v5.2, p. 457, l.5-6).
As such, change the registration result for the `dispatch` callback to
`ompt_set_sometimes` for now, which is fulfilled. Here, an
implementation can dispatch callbacks or trace an implementation-defined
subset of associated event occurrences.

Based on the changed registration result, a tool can then decide if they
are still interested in recording the information provided by the

    [2 lines not shown]
DeltaFile
+1-1openmp/runtime/src/ompt-event-specific.h
+1-11 files

LLVM/project d4430eaclang/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 ad14857clang/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 0d6d014clang/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-1clang/test/CodeGen/systemz-charset.cpp
+2-1clang/lib/Lex/TextEncoding.cpp
+3-0clang/lib/Basic/TargetInfo.cpp
+2-0clang/include/clang/Basic/TargetInfo.h
+21-25 files

LLVM/project 85b44f4clang/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 5029241clang/lib/Sema SemaStmtAsm.cpp, llvm/include/llvm/Support TextEncoding.h

Add isNoop to avoid conversion code in ActOnGCCAsmStmtString
DeltaFile
+7-0llvm/include/llvm/Support/TextEncoding.h
+2-1clang/lib/Sema/SemaStmtAsm.cpp
+2-0llvm/lib/Support/TextEncoding.cpp
+11-13 files

LLVM/project 4f4a268llvm/test/Analysis/LoopAccessAnalysis symbolic-stride.ll, llvm/test/Transforms/LoopVectorize version-stride-with-integer-casts.ll

[LAA] Add more tests with symblic strides with different scales (NFC) (#216128)

Add more test coverage for various cases with strides with different
scales.
DeltaFile
+272-163llvm/test/Transforms/LoopVectorize/version-stride-with-integer-casts.ll
+263-0llvm/test/Analysis/LoopAccessAnalysis/symbolic-stride.ll
+535-1632 files

LLVM/project 002bb95clang/lib/AST FormatString.cpp ScanfFormatString.cpp

change char literals to u8'' to preserve behaviour in the case the
compiler is compiled with a different fexec-charset
DeltaFile
+44-44clang/lib/AST/PrintfFormatString.cpp
+28-28clang/lib/AST/ScanfFormatString.cpp
+28-27clang/lib/AST/FormatString.cpp
+100-993 files

LLVM/project 6c91cadclang/lib/AST ScanfFormatString.cpp PrintfFormatString.cpp, llvm/include/llvm/Support TextEncoding.h

rename char conversion function to convertBasicChar
DeltaFile
+18-17clang/lib/AST/FormatString.cpp
+12-12clang/lib/AST/PrintfFormatString.cpp
+3-5clang/lib/AST/ScanfFormatString.cpp
+3-1llvm/include/llvm/Support/TextEncoding.h
+36-354 files

LLVM/project 71ce0bfclang/include/clang/AST FormatString.h, clang/lib/AST ScanfFormatString.cpp FormatStringParsing.h

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 51a95a8clang/lib/AST ScanfFormatString.cpp FormatStringParsing.h, clang/lib/Sema SemaChecking.cpp

Add format string handling
DeltaFile
+58-31clang/lib/AST/PrintfFormatString.cpp
+46-40clang/lib/AST/FormatString.cpp
+33-21clang/lib/Sema/SemaChecking.cpp
+25-11clang/lib/AST/FormatStringParsing.h
+15-8clang/lib/AST/ScanfFormatString.cpp
+19-0llvm/lib/Support/TextEncoding.cpp
+196-1113 files not shown
+215-1179 files

LLVM/project 509257dclang/include/clang/Sema Sema.h, clang/lib/Parse Parser.cpp

constexpr in asm strings will be in fexec-charset, do not do backwards conversion for those strings
DeltaFile
+24-0clang/test/CodeGen/systemz-charset.cpp
+5-2clang/lib/Sema/SemaStmtAsm.cpp
+4-1clang/lib/Parse/Parser.cpp
+2-1clang/include/clang/Sema/Sema.h
+35-44 files

LLVM/project dabc383openmp/runtime/src/include omp.h.var omp-tools.h.var

[OpenMP][OMPT] Make omp_control_tool enums available in omp-tools.h (#216076)

OpenMP 6.1 will introduce this change: the enums must be available by
including either header file, but including both must also be valid.
DeltaFile
+18-0openmp/runtime/src/include/omp-tools.h.var
+4-0openmp/runtime/src/include/omp.h.var
+22-02 files

LLVM/project 47f7a59clang/include/clang/AST Decl.h, clang/include/clang/Sema Sema.h

[clang] Move DefaultedFunctionKind from Sema to AST (#214846)

I plan on using this to implement DW_AT_defaulted in CGDebugInfo.
Putting this on FunctionDecl itself seems like a better move than
reaching into Sema from CGDebugInfo.

See: https://github.com/llvm/llvm-project/pull/213188
DeltaFile
+0-94clang/include/clang/Sema/Sema.h
+90-0clang/include/clang/AST/Decl.h
+16-70clang/lib/Sema/SemaDeclCXX.cpp
+55-0clang/lib/AST/Decl.cpp
+4-3clang/lib/Sema/SemaAccess.cpp
+3-2clang/lib/Sema/SemaTemplateInstantiate.cpp
+168-1698 files not shown
+181-17714 files

LLVM/project df7a7ee.github/workflows libcxx-benchmark-cron.yml

[libc++] Cache anchor commits in the benchmark cron (#216124)

Selecting the anchor commits is the only step that needs a full monorepo
clone, so we instead cache it and recompute it once per day.

Fixes #215447
DeltaFile
+40-6.github/workflows/libcxx-benchmark-cron.yml
+40-61 files

LLVM/project dbac582lldb/packages/Python/lldbsuite/test/make Makefile.rules

[LLDB] Fix tool dependency tracking on windows (#215927)

On Windows $(CXX) is converted into "$(CXX)" which doesn't work as a
path as needed by dependency tracking. Separate the two uses.
DeltaFile
+6-3lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+6-31 files