LLVM/project f779ebcclang/lib/AST/ByteCode Interp.cpp, clang/test/AST/ByteCode cxx20.cpp

[clang][ExprConst] Add "declared here" notes to uninitialized read diagnostics (#192206)

E.g. for

```c++
constexpr int unInitLocal() {
  int a;
  return a; // both-note {{read of uninitialized object}}
}
static_assert(unInitLocal() == 0, ""); // both-error {{not an integral constant expression}} \
                                       // both-note {{in call to 'unInitLocal()'}}
```

we now diagnose:
```console
array.cpp:896:15: error: static assertion expression is not an integral constant expression
  896 | static_assert(unInitLocal() == 0, ""); // both-error {{not an integral constant expression}} \
      |               ^~~~~~~~~~~~~~~~~~
array.cpp:894:10: note: read of uninitialized object is not allowed in a constant expression

    [15 lines not shown]
DeltaFile
+34-26clang/lib/AST/ByteCode/Interp.cpp
+21-10clang/test/SemaCXX/constant-expression-cxx11.cpp
+18-11clang/test/SemaCXX/constant-expression-cxx2a.cpp
+14-9clang/test/SemaCXX/constant-expression-cxx14.cpp
+12-9clang/test/AST/ByteCode/cxx20.cpp
+15-5clang/test/SemaCXX/constexpr-value-init.cpp
+114-7028 files not shown
+189-12234 files

LLVM/project d6a970dlldb/test/API/commands/memory/read TestMemoryRead.py main.c

[lldb][test] Add tests for repeating "memory read" command (#192063)

Tests that show the effect of #192057.

Until now repeating the command options was only tested in memory
tagging tests, which I don't run often. Here I am adding tests that'll
run anywhere.
DeltaFile
+42-0lldb/test/API/commands/memory/read/TestMemoryRead.py
+4-0lldb/test/API/commands/memory/read/main.c
+46-02 files

LLVM/project 169148aclang-tools-extra/clang-tidy/bugprone ThrowingStaticInitializationCheck.cpp ThrowingStaticInitializationCheck.h, clang-tools-extra/docs ReleaseNotes.rst

[clang-tidy] Add option 'AllowedTypes' to bugprone-throwing-static-initialization (#192031)
DeltaFile
+44-0clang-tools-extra/test/clang-tidy/checkers/bugprone/throwing-static-initialization-allow.cpp
+18-2clang-tools-extra/clang-tidy/bugprone/ThrowingStaticInitializationCheck.cpp
+13-0clang-tools-extra/docs/clang-tidy/checks/bugprone/throwing-static-initialization.rst
+5-2clang-tools-extra/clang-tidy/bugprone/ThrowingStaticInitializationCheck.h
+5-0clang-tools-extra/docs/ReleaseNotes.rst
+85-45 files

LLVM/project d60b2b2llvm/lib/DebugInfo/GSYM GsymReaderV2.cpp GsymReaderV1.cpp

[llvm][DebugInfo] Use formatv in GsymReaderV1 and GsymReaderV2 (#192000)

This relates to #35980.
DeltaFile
+5-4llvm/lib/DebugInfo/GSYM/GsymReaderV2.cpp
+4-3llvm/lib/DebugInfo/GSYM/GsymReaderV1.cpp
+9-72 files

LLVM/project f943685llvm/lib/Transforms/Vectorize VPlanTransforms.cpp LoopVectorizationPlanner.h, llvm/test/Transforms/LoopVectorize/AArch64 partial-reduce-usabs.ll

[LV] Add support for absolute difference partial reductions (#188043)

This adds support for partial reductions where the extended operand is a
signed or unsigned absolute difference.

We match the absolute difference as `abs(sub(ext(X), ext(Y)))`, where
`type(X) == type(Y)` and both extends are the same kind (sext/zext).
This is then handled the same as an operand without a binop
(`ext(...)`), as we will transform the operand to
`ext(absolute-difference(A, B))` when we rewrite the reduction chain to
partial reductions.


This is an alternative to #162296.
DeltaFile
+384-0llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-usabs.ll
+151-0llvm/test/Transforms/LoopVectorize/VPlan/AArch64/partial-reduce-usabs.ll
+56-0llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+5-2llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+6-1llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h
+602-35 files

LLVM/project 3a754f4llvm/test/CodeGen/LoongArch/lsx/ir-instruction shuffle-as-vextrins.ll

[LoongArch][NFC] Pre-commit tests for `vextrins` (#164065)
DeltaFile
+78-0llvm/test/CodeGen/LoongArch/lsx/ir-instruction/shuffle-as-vextrins.ll
+78-01 files

LLVM/project 8ac414fmlir/include/mlir/Dialect/Tosa/IR TosaOps.td, mlir/lib/Dialect/Tosa/IR TosaOps.cpp

[mlir][tosa] Add TOSA RESHAPE_BLOCK_SCALED support (#191149)

Experimental operator support, with no validation.

---------

Signed-off-by: Jeremy Johnson <jeremy.johnson at arm.com>
DeltaFile
+271-0mlir/test/Dialect/Tosa/verifier.mlir
+237-1mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
+97-0mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
+48-0mlir/test/Dialect/Tosa/ops.mlir
+39-0mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
+37-0mlir/test/Dialect/Tosa/level_check.mlir
+729-12 files not shown
+733-48 files

LLVM/project 0499a79compiler-rt/lib/tsan/rtl tsan_platform.h, compiler-rt/test/sanitizer_common/TestCases/Linux pie_no_aslr.cpp

[TSAN][RISCV] Fix kHiAppMemEnd boundary for riscv64 (#191170)

This resolves TSan execution failures on riscv64 platforms when Address
Space Layout Randomization (ASLR) is disabled. There was an off-by-one
error in `tsan_platform.h` that caused the sanitizer to fail when memory
is mapped at the edge under non-ASLR environments. We fix this by
extending `kHiAppMemEnd` to cover the full allowed memory range:

`MappingRiscv64_39`: `0x3fffffffffull` -> `0x4000000000ull`
     `MappingRiscv64_48`: `0x7fffffffffffull` -> `0x800000000000ull`

We also add riscv64 test support to `pie_no_aslr.cpp`
DeltaFile
+4-2compiler-rt/test/sanitizer_common/TestCases/Linux/pie_no_aslr.cpp
+2-2compiler-rt/lib/tsan/rtl/tsan_platform.h
+6-42 files

LLVM/project 7bb42d8clang/test/Sema warn-lifetime-safety-dangling-field.cpp

fix format
DeltaFile
+6-6clang/test/Sema/warn-lifetime-safety-dangling-field.cpp
+6-61 files

LLVM/project ba1acfdllvm/lib/DebugInfo/DWARF DWARFDebugPubTable.cpp

[llvm][DebugInfo] Use formatv in DWARFDebugPubTable (#191988)

This relates to #35980.

Co-authored-by: Sergei Barannikov <barannikov88 at gmail.com>
DeltaFile
+16-8llvm/lib/DebugInfo/DWARF/DWARFDebugPubTable.cpp
+16-81 files

LLVM/project 008c3afllvm/lib/DebugInfo/DWARF DWARFUnitIndex.cpp

[llvm][DebugInfo] Use formatv in DWARFUnitIndex (#191998)

This relates to #35980.
DeltaFile
+9-9llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
+9-91 files

LLVM/project 0d277d6llvm/test/CodeGen/AMDGPU memory-legalizer-private-singlethread.ll memory-legalizer-private-wavefront.ll, llvm/test/CodeGen/RISCV/rvv vfma-vp.ll

Merge branch 'main' into users/zhaoqi5/test-vextrins
DeltaFile
+18,621-0llvm/test/CodeGen/Thumb2/mve-clmul.ll
+4,582-5,914llvm/test/CodeGen/RISCV/rvv/vfma-vp.ll
+8,544-1,366llvm/test/CodeGen/AMDGPU/memory-legalizer-private-singlethread.ll
+8,544-1,366llvm/test/CodeGen/AMDGPU/memory-legalizer-private-wavefront.ll
+8,544-1,366llvm/test/CodeGen/AMDGPU/memory-legalizer-private-workgroup.ll
+8,449-1,355llvm/test/CodeGen/AMDGPU/memory-legalizer-private-cluster.ll
+57,284-11,3679,127 files not shown
+788,090-287,4929,133 files

LLVM/project ec1e3aebolt/include/bolt/Core BinaryContext.h, bolt/lib/Core BinaryContext.cpp

[BOLT] Update LSDA encoding for x86-64 large code model (#190685)

BOLT hardcoded 4-byte LSDA (exception table) encoding for x86-64. This
is insufficient for large code model binaries where functions in .ltext
sections may be placed at addresses above 2GB, exceeding the range of
DW_EH_PE_udata4/DW_EH_PE_sdata4 encodings.

Detect large code model by checking for .ltext sections
(SHF_X86_64_LARGE) and update LSDAEncoding to use 8-byte pointers:
- Non-PIC: DW_EH_PE_absptr (8-byte absolute)
- PIC: DW_EH_PE_pcrel | DW_EH_PE_sdata8 (8-byte PC-relative)

This was pulled out from
https://github.com/llvm/llvm-project/pull/190637
DeltaFile
+112-0bolt/test/X86/lsda-encoding.s
+19-11bolt/lib/Core/BinaryContext.cpp
+9-0bolt/include/bolt/Core/BinaryContext.h
+8-0bolt/lib/Rewrite/RewriteInstance.cpp
+6-0bolt/lib/Utils/CommandLineOpts.cpp
+154-115 files

LLVM/project 882be8fllvm/docs NVPTXUsage.rst, llvm/include/llvm/IR IntrinsicsNVVM.td

[LLVM][NVPTX] Add movmatrix intrinsic and PTX instruction support (#190109)

This change adds NVVM intrinsic and NVPTX backend support for the movmatrix PTX instruction. Tests are added in `movmatrix.ll` and verified through `ptxas-13.1`.

PTX Spec Reference: https://docs.nvidia.com/cuda/parallel-thread-execution/#warp-level-matrix-instructions-movmatrix

Assisted-by: Cursor
DeltaFile
+40-0llvm/test/CodeGen/NVPTX/movmatrix.ll
+36-0llvm/docs/NVPTXUsage.rst
+11-0llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
+6-0llvm/include/llvm/IR/IntrinsicsNVVM.td
+93-04 files

LLVM/project eb8324aclang/docs ReleaseNotes.rst, clang/include/clang/Parse Parser.h

[clang][Parser] Improve error recovery for missing semicolons in class members. (#190744)

This is something I discovered when doing the investigation for
https://github.com/llvm/llvm-project/pull/188123#issuecomment-4162665482.

This patch improves recovery when a semicolon is missing after a class
member declarations.

When the parser expects a semicolon but encounters a token that is at
the start of a line and is a valid declaration specifier, it injects a
`;` instead of skipping tokens, this allows us to preserve the
declaration after the missing ";" instead of discarding it.
DeltaFile
+16-0clang/test/AST/ast-dump-decl-recovery.cpp
+5-0clang/include/clang/Parse/Parser.h
+5-0clang/lib/Parse/Parser.cpp
+4-0clang/docs/ReleaseNotes.rst
+2-1clang/lib/Parse/ParseCXXInlineMethods.cpp
+2-1clang/lib/Parse/ParseDeclCXX.cpp
+34-21 files not shown
+35-37 files

LLVM/project d8f63bbclang/docs ReleaseNotes.rst, clang/lib/Lex Lexer.cpp

[clang] Fix crash in isAtEndOfMacroExpansion at FileID boundary. (#191734)

During error recovery, a synthetic token (whose length is 0) can be
inserted past the end of a FileID, e.g. inserting ")" when a macro-arg
containing a comma should be guarded by parentheses.

When calculating the location after this token, the calculated
`AfterLoc` can point exactly to the start of the next FileID
(`NextLocalOffset`), any source manager operations on the `AfterLoc` are
invalid.
  
This patch adds a safe guard in `Lexer::isAtEndOfMacroExpansion` to
prevent passing this invalid location to `SourceManager`.

 Fixes #115007
 Fixes #21755
DeltaFile
+31-0clang/test/Parser/macro-braces-recovery.cpp
+15-2clang/lib/Lex/Lexer.cpp
+1-1clang/docs/ReleaseNotes.rst
+47-33 files

LLVM/project 982f736clang-tools-extra/clangd Preamble.cpp ClangdServer.cpp, clang-tools-extra/clangd/tool ClangdMain.cpp

[clangd] Introduce --skip-preamble-build command line option (#189284)

This option allows to disable preamble optimization in clangd. By
default it's false, but became true for TUs which import modules (and
experimental modules support is enabled).

This PR is a try to address C++20 modules problems described here
https://github.com/llvm/llvm-project/pull/187432
Fixes https://github.com/llvm/llvm-project/issues/181770
DeltaFile
+52-0clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp
+20-7clang-tools-extra/clangd/Preamble.cpp
+14-0clang-tools-extra/clangd/ClangdServer.cpp
+10-0clang-tools-extra/clangd/ModulesBuilder.cpp
+9-0clang-tools-extra/clangd/tool/ClangdMain.cpp
+6-2clang-tools-extra/clangd/CodeComplete.cpp
+111-95 files not shown
+127-1011 files

LLVM/project 6279043llvm/lib/MC MCAssembler.cpp, llvm/test/MC/ELF prefalign-internal-align.s

[MC] Fix .prefalign oscillation when body contains a .p2align (#192402)

The intervening FT_Align's padding depends on where this prefalign
lands, so body_size can oscillate across relaxOnce iterations.  When a
downstream section reacts (e.g. .debug_line DWARF deltas crossing a
special-opcode boundary), the outer loop never terminates -- originally
reported as a hang with -O1 -g on
https://github.com/llvm/llvm-project/pull/184032#issuecomment-4235991852

```
static int a;
void b() {}
int c() { for (;;) { int d; for (; a;) return 0; } }
void e() { for (;;) ; }
```

X86 sets both the preferred function alignment
and the loop-header alignment to 16 (X86ISelLowering
setPrefLoopAlignment),

    [3 lines not shown]
DeltaFile
+48-0llvm/test/MC/ELF/prefalign-internal-align.s
+6-7llvm/lib/MC/MCAssembler.cpp
+54-72 files

LLVM/project 4c305fblldb/include/lldb/Target StackFrame.h, lldb/source/API SBFrame.cpp

[lldb] Add synthetic variable support to Get*VariableList.

This patch adds a new flag to the lldb_private::StackFrame API to get variable lists: `include_synthetic_vars`.  This allows ScriptedFrame (and other future synthetic frames) to construct 'fake' variables and return them in the VariableList, so that commands like `fr v` and `SBFrame::GetVariables` can show them to the user as requested.

This patch includes all changes necessary to call the API the new way - I tried to use my best judgement on when to include synthetic variables or not and leave comments explaining the decision.

As a consequence of producing synthetic variables, this patch means that ScriptedFrame can produce Variable objects with ValueType that contains a ValueTypeExtendedMask in a high bit. This necessarily complicates some of the switch/case handling in places where we would expect to find such variables, and this patch makes best effort to address all such cases as well. From experience, they tend to show up whenever we're dealing with checking if a Variable is in a specified scope, which means we basically have to check the high bit against some user input saying "yes/no synthetic variables".

stack-info: PR: https://github.com/llvm/llvm-project/pull/181501, branch: users/bzcheeseman/stack/9
DeltaFile
+44-8lldb/source/Plugins/Process/scripted/ScriptedFrame.cpp
+42-10lldb/source/API/SBFrame.cpp
+31-11lldb/source/Commands/CommandObjectFrame.cpp
+27-8lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py
+16-2lldb/source/Target/StackFrame.cpp
+16-0lldb/include/lldb/Target/StackFrame.h
+176-397 files not shown
+214-5513 files

LLVM/project bd81058llvm/test/CodeGen/Thumb2 mve-clmul.ll

[ARM][MVE] Add a MVE clmul tests. NFC (#192403)

Taken from the equivalent AArch64 fixed width tests.
DeltaFile
+18,621-0llvm/test/CodeGen/Thumb2/mve-clmul.ll
+18,621-01 files

LLVM/project ad2bf49clang/lib/Serialization ASTWriter.cpp, clang/unittests/Serialization NoCommentsTest.cpp CommentsTest.cpp

[C++20] [Modules] Write comments in C++20 modules' module file (#192398)

Previously we avoid writing the comments in C++20 modules' module file.

But this prevents LSP tools to read the comments in it. Although we
thought to add a new option for it and ask LSP to use the new option,
the cost of comments seems to be low and new option raises complexity,
so I prefer to write comments in C++20 modules' module file by default
now.
DeltaFile
+0-130clang/unittests/Serialization/NoCommentsTest.cpp
+130-0clang/unittests/Serialization/CommentsTest.cpp
+0-6clang/lib/Serialization/ASTWriter.cpp
+1-1clang/unittests/Serialization/CMakeLists.txt
+131-1374 files

LLVM/project 9dfc03alldb/include/lldb lldb-enumerations.h, lldb/include/lldb/API SBVariablesOptions.h

[lldb] Scaffolding for synthetic variable support.

This patch handles most of the scaffolding for synthetic variable support that isn't directly tied to functional changes. This patch will be used by one following patch that actually modifies the lldb_private::StackFrame API to allow us to fetch synthetic variables.

There were a couple important/interesting decisions made in this patch that should be noted:
- Any value type may be synthetic, which is why it's a mask applied over the top of another value type.
- When printing frame variables with `fr v`, default to showing synthetic variables.

This new value type mask makes some of the ValueType handling more interesting, but since nothing generates objects with this mask until the next patch, we can land the concept in this patch in some amount of isolation.

stack-info: PR: https://github.com/llvm/llvm-project/pull/181500, branch: users/bzcheeseman/stack/8
DeltaFile
+32-0lldb/include/lldb/Utility/ValueType.h
+19-2lldb/source/API/SBVariablesOptions.cpp
+17-2lldb/source/Interpreter/OptionGroupVariable.cpp
+6-0lldb/include/lldb/lldb-enumerations.h
+3-2lldb/include/lldb/Interpreter/OptionGroupVariable.h
+4-0lldb/include/lldb/API/SBVariablesOptions.h
+81-66 files

LLVM/project a735a20lldb/include/lldb/Interpreter OptionGroupVariable.h, lldb/source/Interpreter OptionGroupVariable.cpp

[lldb] Reformat OptionGroupVariable.{h,cpp}, NFC.

This patch runs clang-format on OptionGroupVariable.{h,cpp}.

stack-info: PR: https://github.com/llvm/llvm-project/pull/192395, branch: users/bzcheeseman/stack/10
DeltaFile
+84-21lldb/source/Interpreter/OptionGroupVariable.cpp
+3-3lldb/include/lldb/Interpreter/OptionGroupVariable.h
+87-242 files

LLVM/project 84d5a9cllvm/lib/Target/LoongArch LoongArchISelDAGToDAG.cpp

Address wanglei's comments
DeltaFile
+3-4llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.cpp
+3-41 files

LLVM/project 0dee745lldb/include/lldb/Interpreter OptionGroupVariable.h, lldb/source/Interpreter OptionGroupVariable.cpp

[lldb] Reformat OptionGroupVariable.{h,cpp}, NFC.

This patch runs clang-format on OptionGroupVariable.{h,cpp}.

stack-info: PR: https://github.com/llvm/llvm-project/pull/192395, branch: users/bzcheeseman/stack/10
DeltaFile
+84-21lldb/source/Interpreter/OptionGroupVariable.cpp
+3-3lldb/include/lldb/Interpreter/OptionGroupVariable.h
+87-242 files

LLVM/project 72a3cd9llvm/lib/CodeGen MacroFusion.cpp, llvm/test/CodeGen/AArch64 macro-fusion-cluster-conflict.mir

[MacroFusion] Early return when insts already clustered (#191710)

This patch adds an early return to `fuseInstructionPair()` when macro
fused instructions are already clustered, either by an earlier fusion or
another clustering like ld/st clustering, removing the assert.
    
The assert is generally wrong - there are edge cases where an earlier
ld/st clustering (before macro fusion) reached the assert because it
sets `ParentClusterIdx` and fails. For example, ADRP+LOAD/STORE on
AArch64, thought it seems to be a rare case because the addresses are
ususally unkown at compile time.
    
It doesn't effectively change how fusions are prioritized - early
fusions still win on fusion-fusion conflicts, like before. But it
changes how we resolve the edge case of ld/st-fusion conflicts:
    
Previously, fusions would effectively override ld/st clustering in this
case, given that we currently limits instruction membership to at most a
single cluster through `ParentClusterIdx`. Macro fusion runs after ld/st

    [10 lines not shown]
DeltaFile
+162-0llvm/test/CodeGen/AArch64/macro-fusion-cluster-conflict.mir
+17-16llvm/lib/CodeGen/MacroFusion.cpp
+179-162 files

LLVM/project eea8fb3mlir/lib/Target/LLVMIR/Dialect/OpenMP OpenMPToLLVMIRTranslation.cpp, mlir/test/Target/LLVMIR openmp-target-launch-device.mlir openmp-target-launch-host.mlir

add else block for maxTeamsVals
DeltaFile
+5-3mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+1-1mlir/test/Target/LLVMIR/openmp-target-launch-device.mlir
+1-1mlir/test/Target/LLVMIR/openmp-target-launch-host.mlir
+7-53 files

LLVM/project cb448f7bolt/unittests/Profile DataAggregator.cpp

format
DeltaFile
+1-2bolt/unittests/Profile/DataAggregator.cpp
+1-21 files

LLVM/project 178ef93mlir/lib/Target/LLVMIR/Dialect/OpenMP OpenMPToLLVMIRTranslation.cpp, mlir/test/Target/LLVMIR openmp-target-launch-host.mlir openmp-target-launch-device.mlir

update
DeltaFile
+30-40mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+24-4mlir/test/Target/LLVMIR/openmp-target-launch-host.mlir
+19-0mlir/test/Target/LLVMIR/openmp-target-launch-device.mlir
+73-443 files

LLVM/project 3a85815mlir/lib/Target/LLVMIR/Dialect/OpenMP OpenMPToLLVMIRTranslation.cpp, mlir/test/Target/LLVMIR openmp-todo.mlir openmp-target-launch-host.mlir

[OpenMP][MLIR] Add num_teams mlir to llvm lowering
DeltaFile
+83-34mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+18-2mlir/test/Target/LLVMIR/openmp-todo.mlir
+3-3mlir/test/Target/LLVMIR/openmp-target-launch-host.mlir
+104-393 files