LLVM/project 90e8debllvm/lib/Bitcode/Reader BitcodeReader.cpp

[MemProf] Optimize BitcodeReader stack id lookups (#182097)

Introduce StackIdToIndex to ModuleSummaryIndexBitcodeReader to cache the
mapping from module-local stack id indices to the global index in the
ModuleSummaryIndex's StackIds vector. This avoids repeated hash lookups
when processing callsite and allocation records.

This reduced the thin link time for a large target built with memprof
by ~16%.

Also add assertions to ensure STACK_IDS records are processed once and
that the cache is empty initially.
DeltaFile
+22-13llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+22-131 files

LLVM/project 5df3d91clang/include/clang/Analysis/FlowSensitive DataflowAnalysisContext.h, clang/lib/Analysis/FlowSensitive DataflowAnalysisContext.cpp RecordOps.cpp

[clang][dataflow] Cache getModeledFields (#180878)

Cache getModeledFields at the DataflowAnalysisContext level, since
different contexts could have different ModeledFields for the same type,
and helps cap the memory usage by being scoped. This isn't the most
sharing we can get, but still effective (~70% hit rate). Otherwise, the
underlying getFieldsFromClassHierarchy is repeated many times and can
end up taking 4.6% of a run (geomean across some benchmarks), compared
to 40% for parsing, and 5.3% for querySolver for the same benchmarks. So
not insignificant since we also wonder if querySolver is expensive.

Also change the return type to a reference, now that it is not fresh Set
each time (though that copy is minor).
DeltaFile
+17-4clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h
+11-1clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
+2-2clang/lib/Analysis/FlowSensitive/RecordOps.cpp
+30-73 files

LLVM/project 188fb93clang/lib/StaticAnalyzer/Checkers/WebKit PtrTypesSemantics.cpp NoDeleteChecker.cpp, clang/test/Analysis/Checkers/WebKit nodelete-annotation.cpp mock-types.h

[WebKit Checkers] Trivial analysis should check destructors of function parameters and local variables (#181576)

This PR fixes the bug in TrivialFunctionAnalysisVisitor that it wasn't
checking the triviality of destructors of function parameters and local
variables. This meant that code calls a non-trivial desturctors such as
RefPtr<T>::~RefPtr<T> which calls T::~T to be incorrectly treated as
trivial, resulting in false negatives.

To do this, we manually visit every function parameter and local
variable declaration and check the triviality of its destructor
recursively.

Also fix a bug that we were checking isVirtualAsWritten instead of
isVirtual in IsFunctionTrivial.

---------

Co-authored-by: Balazs Benics <benicsbalazs at gmail.com>
DeltaFile
+123-0clang/test/Analysis/Checkers/WebKit/nodelete-annotation.cpp
+74-8clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
+29-13clang/test/Analysis/Checkers/WebKit/mock-types.h
+5-1clang/lib/StaticAnalyzer/Checkers/WebKit/NoDeleteChecker.cpp
+6-0clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp
+5-0clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h
+242-226 files

LLVM/project 9248d19mlir/lib/Dialect/LLVMIR/IR LLVMDialect.cpp, mlir/test/Dialect/LLVMIR invalid.mlir

[mlir][LLVM] Fix verifier crash for llvm.blockaddress with missing function  (#181519)

### Whats the Problem 
Fix verifier crash in `llvm.blockaddress` when the referenced function
symbol is missing by guarding null before `dyn_cast`.
Adds regression test using `-verify-diagnostics` to ensure invalid IR
emits an error instead of aborting.

### Why it happened
`SymbolTable::lookupNearestSymbolFrom` may return null, and `dyn_cast`
on a non-existent value triggers an assertion in `mlir-opt`.

### Whats the Fix
Split symbol lookup returning early if lookup fails or symbol is not an
`LLVMFuncOp`.
Verifier now reports “expects an existing block label target” instead of
hitting `dyn_cast` assert.

Fixes #181451
DeltaFile
+5-3mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
+7-0mlir/test/Dialect/LLVMIR/invalid.mlir
+12-32 files

LLVM/project 790bef9llvm/lib/Target/AMDGPU AMDGPU.td, llvm/lib/TargetParser TargetParser.cpp

[AMDGPU] Remove V_DOT2ACC_F32_F16 from gfx1170 (#182088)

DeltaFile
+11-0llvm/test/MC/AMDGPU/gfx1170_unsupported.s
+3-1llvm/lib/Target/AMDGPU/AMDGPU.td
+0-1llvm/lib/TargetParser/TargetParser.cpp
+1-0llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fdot2.ll
+15-24 files

LLVM/project 76ddcdfclang/lib/Sema SemaInit.cpp, clang/test/CodeGenHLSL/BasicFeatures MatrixToAndFromVectorConstructors.hlsl

[Sema][HLSL][Matrix] Make matrices initializable by a single vector and vice-versa (#177486)

Fixes #169561

The problem was that the logic for determining whether or not to convert
constructor syntax into list initialization did not account for cases
where the constructor only had a single argument. Thus, the constructor
for a matrix with a single vector, or a vector with a single matrix did
not convert to list initialization despite being valid (in DXC).

This PR allows constructor syntax to be converted into list
initialization when the number of arguments in the constructor is 1, but
if and only if the destination type is a matrix/vector and the source
type is a vector/matrix.
DeltaFile
+121-0clang/test/CodeGenHLSL/BasicFeatures/MatrixToAndFromVectorConstructors.hlsl
+33-4clang/lib/Sema/SemaInit.cpp
+7-2clang/test/SemaHLSL/Types/BuiltinMatrix/MatrixSplatErrors.hlsl
+161-63 files

LLVM/project 9b3470dllvm/lib/CodeGen/SelectionDAG TargetLowering.cpp, llvm/test/CodeGen/PowerPC clmul-vector.ll

[DAG] expandCLMUL - unroll vector clmul if vector multiplies are not supported (#182041)

Fixes powerpc cases reported on #182039

I'm hoping #177566 can be adapted to improve upon this.
DeltaFile
+8,874-0llvm/test/CodeGen/PowerPC/clmul-vector.ll
+4-0llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+8,878-02 files

LLVM/project e612350lldb/packages/Python/lldbsuite/test/tools/lldb-dap lldbdap_testcase.py dap_server.py

[lldb-dap][NFC] Modernize events handling in tests (#181542)

Migrated `initialized` and `memory` events to new style handling.
DeltaFile
+9-18lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
+12-7lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+21-252 files

LLVM/project e58d325lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/map TestDataFormatterStdMap.py

[lldb] Disable shared build dir for TestDataFormatterStdMap.py (#182096)

Follow up to #181720. This test failed on builder lldb-x86_64-debian.
DeltaFile
+1-0lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/map/TestDataFormatterStdMap.py
+1-01 files

LLVM/project fb48c99llvm/lib/Target/AMDGPU AMDGPULowerVGPREncoding.cpp, llvm/test/CodeGen/AMDGPU vgpr-lowering-gfx1250.mir

[AMDGPU] Commute instructions to avoid VGPR MSB changes
DeltaFile
+25-18llvm/test/CodeGen/AMDGPU/vgpr-lowering-gfx1250.mir
+22-0llvm/lib/Target/AMDGPU/AMDGPULowerVGPREncoding.cpp
+47-182 files

LLVM/project 9bf16e4lldb/source/Plugins/Highlighter/TreeSitter/Rust RustTreeSitterHighlighter.cpp, lldb/source/Plugins/Highlighter/TreeSitter/Rust/tree-sitter-rust grammar.js scanner.c

[lldb] Add tree-sitter based Rust syntax highlighting
DeltaFile
+1,690-0lldb/source/Plugins/Highlighter/TreeSitter/Rust/tree-sitter-rust/grammar.js
+393-0lldb/source/Plugins/Highlighter/TreeSitter/Rust/tree-sitter-rust/scanner.c
+161-0lldb/source/Plugins/Highlighter/TreeSitter/Rust/tree-sitter-rust/highlights.scm
+126-1lldb/unittests/Highlighter/HighlighterTest.cpp
+53-0lldb/source/Plugins/Highlighter/TreeSitter/Rust/tree-sitter-rust/tree-sitter.json
+43-0lldb/source/Plugins/Highlighter/TreeSitter/Rust/RustTreeSitterHighlighter.cpp
+2,466-17 files not shown
+2,568-313 files

LLVM/project 15488a7clang/test/Driver emit-reproducer.c, clang/tools/driver driver.cpp

[LLVM][CLANG] Update signal-handling behavior to comply with POSIX (#169340)

The POSIX standard
[POSIX.1-2024](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap01.html#tag_18)
specifies how the utility reacts to signals as follows. This includes
clang when invoke through a invocation such as
[c17](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/c17.html)
```
ASYNCHRONOUS EVENTS

    The ASYNCHRONOUS EVENTS section lists how the utility reacts to such events as signals and what signals are caught.

    Default Behavior: When this section is listed as "Default.", or it refers to "the standard action" for any signal, it means that the action taken as a result of the signal shall be as follows:

        If the action inherited from the invoking process, according to the rules of inheritance of signal actions defined in the System Interfaces volume of POSIX.1-2024, is for the signal to be ignored, the utility shall ignore the signal.
        If the action inherited from the invoking process, according to the rules of inheritance of signal actions defined in System Interfaces volume of POSIX.1-2024, is the default signal action, the result of the utility's execution shall be as if the default signal action had been taken.

    When the required action is for the signal to terminate the utility, the utility may catch the signal, perform some additional processing (such as deleting temporary files), restore the default signal action, and resignal itself.
```

    [9 lines not shown]
DeltaFile
+48-10llvm/lib/Support/Unix/Signals.inc
+18-7llvm/lib/Support/CrashRecoveryContext.cpp
+18-2clang/tools/driver/driver.cpp
+7-7clang/test/Driver/emit-reproducer.c
+6-3llvm/include/llvm/Support/InitLLVM.h
+7-1llvm/lib/Support/InitLLVM.cpp
+104-3016 files not shown
+146-4722 files

LLVM/project 507b7fellvm/lib/Analysis ConstantFolding.cpp, llvm/test/Transforms/InstSimplify/ConstProp vector-type-constant-folding.ll

Revert "[ConstantFolding] Fix type mismatch in ConstantFolding for vector typ…"

This reverts commit ee3068bd18b23ceb30c0464395fa182cfa28a5fb.
DeltaFile
+0-25llvm/test/Transforms/InstSimplify/ConstProp/vector-type-constant-folding.ll
+2-1llvm/lib/Analysis/ConstantFolding.cpp
+2-262 files

LLVM/project 27144f4llvm/lib/Target/AArch64 AArch64InstrInfo.h, llvm/lib/Target/AMDGPU SIInstrInfo.h SIInstrInfo.cpp

[TableGen] Return int32_t from InstrMapping table lookup functions. NFC. (#182079)

Since #182059 there is only one case in which these functions return -1,
so callers no longer need to distinguish between (int64_t)-1 and
(uint32_t)-1, so we can go back to a 32-bit return value like it was
before #180954.
DeltaFile
+21-21llvm/lib/Target/AMDGPU/SIInstrInfo.h
+4-4llvm/lib/Target/AArch64/AArch64InstrInfo.h
+3-3llvm/lib/Target/WebAssembly/TargetInfo/WebAssemblyTargetInfo.h
+5-1llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp
+2-2llvm/lib/Target/SystemZ/SystemZInstrInfo.h
+2-2llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+37-335 files not shown
+43-3911 files

LLVM/project ee3068bllvm/lib/Analysis ConstantFolding.cpp, llvm/test/Transforms/InstSimplify/ConstProp vector-type-constant-folding.ll

[ConstantFolding] Fix type mismatch in ConstantFolding for vector types. (#181695)

Drop `Bitcast` case from `IsConstantOffsetFromGlobal` to avoid
misdetections.
DeltaFile
+25-0llvm/test/Transforms/InstSimplify/ConstProp/vector-type-constant-folding.ll
+1-2llvm/lib/Analysis/ConstantFolding.cpp
+26-22 files

LLVM/project 952fae4lldb/unittests/Highlighter HighlighterTest.cpp

Add if let keyword test
DeltaFile
+2-0lldb/unittests/Highlighter/HighlighterTest.cpp
+2-01 files

LLVM/project cc0d7bfutils/bazel/llvm-project-overlay/lldb/source/Plugins BUILD.bazel

[bazel] Fix Bazel build for 5c8d247 (#182092)

Co-authored-by: Pranav Kant <prka at google.com>
DeltaFile
+1-0utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel
+1-01 files

LLVM/project 9595905clang/include/clang/Analysis/Scalable/Serialization SerializationFormatRegistry.h

[clang][ssaf] Improve docs of SerializationFormatRegistry (#181847)

DeltaFile
+19-2clang/include/clang/Analysis/Scalable/Serialization/SerializationFormatRegistry.h
+19-21 files

LLVM/project 3549507clang/lib/CodeGen/TargetBuiltins ARM.cpp, clang/lib/Sema SemaARM.cpp

[clang][ARM] Refactor argument handling in `EmitAArch64BuiltinExpr` (2/2) (NFC)

Refactor `EmitAArch64BuiltinExpr` so that all AArch64/NEON builtins
handled by this hook _and marked as overloaded_ share a common path
for generating LLVM IR arguments (collected into the `Ops`
`SmallVector<Value*>`) (*). This is a follow-up for #181794 - please
refer to that PR for more context.

As in the previous PR, the key change is implemented in
`HasExtraNeonArgument` , i.e. in the hook that identifies Builtins with
the extra argument. In this PR, I am replacing the ad-hoc switch
statement with a more principled approach borrowed from SemaARM.cpp,
namely:
```cpp
uint64_t mask = 0;
  switch (BuiltinID) {
  #define GET_NEON_OVERLOAD_CHECK
  #include "clang/Basic/arm_fp16.inc"
  #include "clang/Basic/arm_neon.inc"

    [28 lines not shown]
DeltaFile
+48-254clang/lib/CodeGen/TargetBuiltins/ARM.cpp
+3-1clang/lib/Sema/SemaARM.cpp
+51-2552 files

LLVM/project 7c0cbb1clang/lib/Sema SemaHLSL.cpp, clang/test/CodeGenHLSL/resources cbuffer_matrix_align.hlsl

[HLSL] Define CBuffer field alignment for matrix types (#179836)

fixes https://github.com/llvm/llvm-project/issues/179834

Change defines Matrix alignment as buffer row length (16). Same as
arrays and structs.
Change also adds tests for matrix, matrix in structs, & arrays.
DeltaFile
+71-0clang/test/CodeGenHLSL/resources/cbuffer_matrix_align.hlsl
+2-2clang/lib/Sema/SemaHLSL.cpp
+73-22 files

LLVM/project f90447fclang/lib/CodeGen/TargetBuiltins ARM.cpp, clang/test/CodeGen arm64-microsoft-intrinsics.c

[clang][ARM] Refactor argument handling in `EmitAArch64BuiltinExpr` (1/2) (NFC)

Refactor `EmitAArch64BuiltinExpr` so that all AArch64/NEON builtins
handled by this hook _and marked as non-overloaded_ share a common path
for generating LLVM IR arguments (collected into the `Ops`
`SmallVector<Value*>`) (*)

Previously, the argument emission loop unconditionally skipped the
trailing argument:

```cpp
  for (unsigned i = 0, e = E->getNumArgs() - 1; i != e; ++i)
```

This was originally intended to ignore the extra Sema-only argument
used by overloaded NEON builtins (e.g. the type discriminator passed
by `__builtin_neon_*` intrinsics). However, this logic was applied
unconditionally.


    [37 lines not shown]
DeltaFile
+225-79clang/lib/CodeGen/TargetBuiltins/ARM.cpp
+16-16clang/test/CodeGen/arm64-microsoft-intrinsics.c
+241-952 files

LLVM/project ca21a65clang/lib/CodeGen HLSLBufferLayoutBuilder.cpp CGHLSLRuntime.cpp, clang/test/CodeGenHLSL matrix_types.hlsl

[HLSL][Cbuffer][Matrix] Add Cbuffer padding and createBufferMatrixTempAddress (#181903)

fixes #181901

This change detects when a HLSL Cbuffer matrix’s layout differs from its
in-memory type and materializes a temporary with the non-padded matrix
type. Matrix elements are copied explicitly from the padded buffer
layout into the temporary, ensuring correct addressing and avoiding
overlapping GEPs or incorrect vector flattening.
DeltaFile
+18-18clang/test/CodeGenHLSL/matrix_types.hlsl
+23-4clang/lib/CodeGen/HLSLBufferLayoutBuilder.cpp
+26-0clang/lib/CodeGen/CGHLSLRuntime.cpp
+10-1clang/lib/CodeGen/CGExpr.cpp
+9-2clang/test/CodeGenHLSL/resources/default_cbuffer_with_layout.hlsl
+7-0clang/lib/CodeGen/HLSLBufferLayoutBuilder.h
+93-251 files not shown
+96-257 files

LLVM/project 157f820clang-tools-extra/clangd TidyProvider.cpp

[clangd] Add abseil-unchecked-statusor-access to list of ignored checks (#181864)

This
[check](https://clang.llvm.org/extra/clang-tidy/checks/abseil/unchecked-statusor-access.html)
also depends on dataflow framework.
DeltaFile
+2-1clang-tools-extra/clangd/TidyProvider.cpp
+2-11 files

LLVM/project f7fe0abllvm/lib/Target/AMDGPU AMDGPULowerVGPREncoding.cpp, llvm/test/CodeGen/AMDGPU vgpr-lowering-gfx1250.mir

[AMDGPU] Commute instructions to avoid VGPR MSB changes
DeltaFile
+25-18llvm/test/CodeGen/AMDGPU/vgpr-lowering-gfx1250.mir
+23-0llvm/lib/Target/AMDGPU/AMDGPULowerVGPREncoding.cpp
+48-182 files

LLVM/project 89065b5llvm/cmake/modules HandleLLVMOptions.cmake

[NFC] Re-enable MSVC C4351 diagnostic (#182082)

From MSDN:
https://learn.microsoft.com/en-us/previous-versions/1ywe7hcy(v=vs.140)

This diagnostic is no longer documented in MSDN and from my local
testing, the diagnostic is not emitted in our source. I believe we no
longer need to disable this diagnostic.
DeltaFile
+0-1llvm/cmake/modules/HandleLLVMOptions.cmake
+0-11 files

LLVM/project b9225e8lldb/packages/Python/lldbsuite/test lldbtest.py, lldb/test/API/commands/trace TestTraceStartStop.py

[lldb] Allow tests to share a single build (#181720)

This changes Python API tests to use a single build shared across all
test functions, instead of the previous default behavior of a separate
build dir for each test function.

This build behavior opt-out, tests can use the previous behavior of one
individual (unshared) build directory per test function, by setting
`SHARED_BUILD_TESTCASE` to False (in the test class).

The motivation is to make the test suite more efficient, by not
repeatedly building the same test source. When running tests on my macOS
machine, this reduces the time of `ninja check-lldb-api` by almost 60%
(sample numbers: from ~492s down to ~207s = 58%). Almost 5min time
saved.

Each test function still calls `self.build()`, but only the first call
will do a build, in the subsequent tests `make` will be a no-op because
the sources won't have changed.
DeltaFile
+12-4lldb/packages/Python/lldbsuite/test/lldbtest.py
+2-0lldb/test/API/macosx/lc-note/firmware-corefile/TestFirmwareCorefiles.py
+2-0lldb/test/API/commands/trace/TestTraceStartStop.py
+2-0lldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
+2-0lldb/test/API/functionalities/breakpoint/objc/TestObjCBreakpoints.py
+2-0lldb/test/API/functionalities/gdb_remote_client/TestPty.py
+22-444 files not shown
+93-450 files

LLVM/project ada69a1clang/lib/CIR/CodeGen CIRGenBuiltinAArch64.cpp, clang/test/CodeGen/AArch64 v8.2a-fp16-intrinsics.c

[CIR][NEON] Add lowering for `vfmah_f16` and `vfmsh_f16` (#181148)

As with other NEON builtins, reuse the existing default-lowering
tests to validate the CIR lowering path.
DeltaFile
+57-5clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
+22-0clang/test/CodeGen/AArch64/neon/fullfp16.c
+0-16clang/test/CodeGen/AArch64/v8.2a-fp16-intrinsics.c
+79-213 files

LLVM/project c5cbd1allvm/lib/Target/SPIRV SPIRVGlobalRegistry.cpp SPIRVGlobalRegistry.h

[NFC][SPIRV] Remove last uses of SPIRVType and do some renaming for consistency
DeltaFile
+50-47llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
+7-5llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
+4-4llvm/lib/Target/SPIRV/SPIRVISelLowering.cpp
+0-6llvm/lib/Target/SPIRV/SPIRVTypeInst.h
+61-624 files

LLVM/project 29c768clldb/packages/Python/lldbsuite/test/tools/lldb-dap lldbdap_testcase.py dap_server.py, lldb/test/API/tools/lldb-dap/variables TestDAP_variables.py

[lldb-dap] Add hex format in setVariable request (#181968)

Added hex format support in `setVariable` request according to DAP
specification.
DeltaFile
+20-0lldb/unittests/DAP/ProtocolRequestsTest.cpp
+10-0lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py
+6-4lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
+4-2lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+2-1lldb/tools/lldb-dap/Handler/SetVariableRequestHandler.cpp
+1-1lldb/tools/lldb-dap/Protocol/ProtocolRequests.h
+43-86 files

LLVM/project a51bc25mlir/test/Integration/Dialect/XeGPU/LANE no-xegpu-ops.mlir

[MLIR][XeGPU] Add LANE level integration test without XeGPU ops. (#181891)

XeGPU LANE level integration test lacks a test without usage of any
XeGPU dialect ops.
Add an integration test without XeGPU dialect ops.
DeltaFile
+53-0mlir/test/Integration/Dialect/XeGPU/LANE/no-xegpu-ops.mlir
+53-01 files