LLVM/project a74d909llvm/test/CodeGen/AArch64 clmul-fixed.ll clmul.ll, llvm/test/CodeGen/PowerPC clmul-vector.ll

Address comments

Created using spr 1.3.7
DeltaFile
+54,752-7,425llvm/test/CodeGen/RISCV/rvv/clmulh-sdnode.ll
+18,872-3,329llvm/test/CodeGen/RISCV/rvv/clmul-sdnode.ll
+3,105-3,034llvm/test/CodeGen/AArch64/clmul-fixed.ll
+2,338-2,209llvm/test/CodeGen/PowerPC/clmul-vector.ll
+1,223-1,171llvm/test/CodeGen/AArch64/clmul.ll
+730-700llvm/test/CodeGen/RISCV/rvv/nontemporal-vp-scalable.ll
+81,020-17,8681,092 files not shown
+120,486-31,1201,098 files

LLVM/project c32caeemlir/lib/Dialect/SPIRV/Transforms SPIRVConversion.cpp, mlir/test/Conversion/ConvertToSPIRV func-signature-vector-unroll.mlir

[mlir][spirv] Fix crash in FuncOpVectorUnroll for dynamic-shaped tensor args (#184626)

FuncOpVectorUnroll::matchAndRewrite iterates over all function arguments
and creates a zero-constant placeholder for any non-vector argument via
rewriter.getZeroAttr(type). For dynamically-shaped tensor types such as
tensor<?x2xi8>, getZeroAttr ultimately calls
DenseIntOrFPElementsAttr::getRaw which asserts that the type has a
static shape.

Add an early pre-check that returns failure() for any non-vector
argument with a dynamically-shaped type. This must be done before any IR
modifications are made, since returning failure() after inlining the
function body would leave the IR in an inconsistent state.

Fixes #148369
DeltaFile
+12-0mlir/test/Conversion/ConvertToSPIRV/func-signature-vector-unroll.mlir
+9-0mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp
+21-02 files

LLVM/project d07ab18mlir/lib/IR Verifier.cpp, mlir/unittests/IR VerifierTest.cpp CMakeLists.txt

[mlir] Add cross-context checks to the IR verifier (#184627)

Detect IR where result types, operand types, or discardable attribute
values come from a different MLIRContext than the operation itself.
Mixing contexts is a latent use-after-free hazard when one context is
destroyed before the other; the verifier now reports a clear error
instead of silently allowing the invalid IR through.

Three new unit tests in MLIRIRTests cover each scenario.

Fix #61569
DeltaFile
+177-0mlir/unittests/IR/VerifierTest.cpp
+60-3mlir/lib/IR/Verifier.cpp
+1-0mlir/unittests/IR/CMakeLists.txt
+238-33 files

LLVM/project 61d8e5cmlir/lib/Dialect/Vector/Utils VectorUtils.cpp, mlir/test/Dialect/Affine/SuperVectorize vector_utils.mlir

[MLIR][Vector] Fix crash in operatesOnSuperVectorsOf on rank-mismatched shaped (#183967)

The `operatesOnSuperVectorsOf` function in VectorUtils.cpp contained an
assertion that fired when a `vector.transfer` operation's vector type
had a different rank (or non-divisible shape) from the sub-vector type
supplied by the caller:

  assert((ratio || \!mustDivide) &&
"vector.transfer operation in which super-vector size is not an"
         " integer multiple of sub-vector size");

This assertion was incorrect because the function's callers (e.g., the
affine super-vectorizer) legitimately pass transfer ops whose vector
type doesn't match the requested sub-vector shape. In those cases the
correct answer is simply that the op does not operate on a super-vector
of that sub-vector type, so `operatesOnSuperVectorsOf` should return
`false`.

Remove the assert return `false` when `computeShapeRatio` produces no

    [3 lines not shown]
DeltaFile
+3-15mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp
+17-0mlir/test/Dialect/Affine/SuperVectorize/vector_utils.mlir
+20-152 files

LLVM/project 6b7a3b3clang-tools-extra/clang-tidy/performance FasterStringFindCheck.cpp, clang-tools-extra/docs ReleaseNotes.rst

[clang-tidy] Teach `performance-faster-string-find` about `operator+=` (#182697)

This is a followup to #182633. Like in that PR, `operator+=` doesn't fit
with the check name, but the same optimization is applicable to it:
https://en.cppreference.com/w/cpp/string/basic_string/operator+=.html
DeltaFile
+13-6clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp
+11-0clang-tools-extra/test/clang-tidy/checkers/performance/faster-string-find.cpp
+2-2clang-tools-extra/docs/ReleaseNotes.rst
+2-2clang-tools-extra/docs/clang-tidy/checks/performance/faster-string-find.rst
+28-104 files

LLVM/project 4427575llvm/tools/dsymutil DebugMap.h

[dsymutil] Add DebugMapObjectFilter destructor (#184701)

Fixes #182083.
DeltaFile
+1-0llvm/tools/dsymutil/DebugMap.h
+1-01 files

LLVM/project bfe349cllvm/lib/Target/AMDGPU AMDGPULowerVGPREncoding.cpp, llvm/test/CodeGen/AMDGPU vgpr-setreg-mode-swar.mir

[AMDGPU] Optimize S_SETREG_IMM32_B32 piggybacking by treating it as a mode scope boundary (#184703)

When `handleSetregMode` encounters an `S_SETREG_IMM32_B32` with `Size <=
12`, the instruction's `imm32[12:19]` bits are "free" for VGPR MSB
piggybacking. Previously, the old mode was eagerly written into these
bits, but the `Rewritten` guard in `setMode` would then block subsequent
piggybacking when the next VGPR instruction needed a different mode,
causing an unnecessary `S_SET_VGPR_MSB` to be emitted.

Model the `S_SETREG_IMM32_B32` as the boundary of the old mode's control
range: reset `CurrentMode` and clear `bits[12:19]` to zero. This lets
the next `setMode` call freely piggyback the required mode without
triggering `Rewritten`.
DeltaFile
+21-22llvm/test/CodeGen/AMDGPU/vgpr-setreg-mode-swar.mir
+5-3llvm/lib/Target/AMDGPU/AMDGPULowerVGPREncoding.cpp
+26-252 files

LLVM/project 576c244lldb/test/API/functionalities/breakpoint/breakpoint_conditions/crashing_condition TestCrashingCondition.py main.c

Add a test for handling a crashing breakpoint condition (#184247)

I was working on something and broke the handling of breakpoint
conditions that crash. In fixing that I noticed that there wasn't a test
for this scenario, so this PR adds one.

---------

Co-authored-by: Med Ismail Bennani <ismail at bennani.ma>
DeltaFile
+57-0lldb/test/API/functionalities/breakpoint/breakpoint_conditions/crashing_condition/TestCrashingCondition.py
+11-0lldb/test/API/functionalities/breakpoint/breakpoint_conditions/crashing_condition/main.c
+4-0lldb/test/API/functionalities/breakpoint/breakpoint_conditions/crashing_condition/Makefile
+72-03 files

LLVM/project 18b648clibclc CMakeLists.txt, libclc/clc/lib/generic/async clc_prefetch.inc

[libclc][NFC] Add -Wall -Wextra to build flags and fix build warnings (#184549)

Co-authored-by: Copilot <175728472+Copilot at users.noreply.github.com>
DeltaFile
+4-1libclc/clc/lib/generic/async/clc_prefetch.inc
+0-4libclc/clc/lib/generic/math/clc_fmod.cl
+3-0libclc/clc/lib/ptx-nvidiacl/synchronization/clc_work_group_barrier.cl
+1-1libclc/clc/lib/generic/math/clc_erfc.cl
+2-0libclc/CMakeLists.txt
+2-0libclc/clc/lib/ptx-nvidiacl/mem_fence/clc_mem_fence.cl
+12-65 files not shown
+14-1011 files

LLVM/project 537f3d3llvm/lib/CodeGen SafeStack.cpp, llvm/test/CodeGen/AArch64 safestack_scalar.ll

[SafeStack] Fix crashing with scalable TypeSizes (#180547)

On e.g. aarch64 the TypeSize of scalar types can have a size that is not
known at compile time.
Currently when safestack occurs those it simply crashes as described in
https://github.com/llvm/llvm-project/issues/175868.

Since we cannot verify the size at compile time we simply consider the
access to be unsafe (in regards to safestack).

Reproducer:
```
#include <arm_sve.h>

int main() {
    svint32_t vec = svindex_s32(0, 1);
    svint32_t res = svadd_s32_z(svptrue_b32(), vec, vec);
    int32_t buffer[1024];
    svst1_s32(svptrue_b32(), buffer, res);

    [2 lines not shown]
DeltaFile
+17-0llvm/test/CodeGen/AArch64/safestack_scalar.ll
+12-0llvm/lib/CodeGen/SafeStack.cpp
+29-02 files

LLVM/project cee0703lldb/test/API/python_api/block TestFrameBlocks.py TestBlocks.py

[lldb] Fixing the python_api/block tests. (#184647)

Renaming the file to be unique and updating the symbols for Windows.
DeltaFile
+59-0lldb/test/API/python_api/block/TestFrameBlocks.py
+0-59lldb/test/API/python_api/block/TestBlocks.py
+1-1lldb/test/API/python_api/block/fn.c
+1-1lldb/test/API/python_api/block/main.c
+61-614 files

LLVM/project 8c2d6cblldb/source/Plugins/Process/Utility RegisterInfos_arm64.h RegisterInfos_arm64_sve.h

[lldb] Fix the AArch64 CPSR reg defn to list generic reg

My change to remove an incorrect DWARF register number for
CPSR unintentionally dropped the LLDB_REGNUM_GENERIC_FLAGS
generic reg type in the definitions of cpsr.

We need to have a macro (DEFINE_MISC_REGS) for status/control
registers that have no DWARF/eh_frame and no generic reg num.

I added a new macro, DEFINE_GPR_CPSR, for cpsr which is unique
in having no DWARF/eh_frame numbers but does have a generic
flags reg number.
DeltaFile
+15-6lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h
+1-2lldb/source/Plugins/Process/Utility/RegisterInfos_arm64_sve.h
+16-82 files

LLVM/project 521c2e1lldb/unittests/Host SocketTest.cpp, lldb/unittests/Interpreter TestCompletion.cpp

[llvm][Support] Make createUniquePath require at least one wildcard marker (#184688)

The API was a bit easy to accidentally mis-use, as it silently accepted
Model strings without any randomness marker characters (`%`), which
results in a unique path that's not at all unique. To avoid this
foot-gun, we now assert that the model contains at least one, and update
all the broken usages accordingly.

rdar://170349565
DeltaFile
+11-11llvm/unittests/Support/Path.cpp
+8-5llvm/unittests/Support/raw_socket_stream_test.cpp
+3-2lldb/unittests/Interpreter/TestCompletion.cpp
+2-2lldb/unittests/Host/SocketTest.cpp
+3-0llvm/lib/Support/Path.cpp
+1-1llvm/include/llvm/Support/FileSystem.h
+28-211 files not shown
+29-227 files

LLVM/project f4a20a0clang/test/CIR/CodeGen complex-compound-assignment.cpp complex-mul-div.cpp

[CIR][NFCI] Fixup some test regressions due to OGCG changes (#184699)

Discovered during CI in a different patch, 3 tests started failing for
unknown reasons due to some very mild changes to the IR, but only in
'classic' codgen parts of the tests. These tests were overly specific
for no good reason, so this patch just fixes that.
DeltaFile
+2-2clang/test/CIR/CodeGen/complex-compound-assignment.cpp
+2-2clang/test/CIR/CodeGen/complex-mul-div.cpp
+1-1clang/test/CIR/CodeGen/optsize-func-attr.cpp
+5-53 files

LLVM/project d57ae29llvm/lib/Target/AMDGPU AMDGPULowerVGPREncoding.cpp, llvm/test/CodeGen/AMDGPU vgpr-setreg-mode-swar.mir

[AMDGPU] Optimize S_SETREG_IMM32_B32 piggybacking by treating it as a mode scope boundary

When `handleSetregMode` encounters an `S_SETREG_IMM32_B32` with `Size <= 12`,
the instruction's `imm32[12:19]` bits are "free" for VGPR MSB piggybacking.
Previously, the old mode was eagerly written into these bits, but the
`Rewritten` guard in `setMode` would then block subsequent piggybacking when the
next VGPR instruction needed a different mode, causing an unnecessary
`S_SET_VGPR_MSB` to be emitted.

Model the `S_SETREG_IMM32_B32` as the boundary of the old mode's control range:
reset `CurrentMode` and clear `bits[12:19]` to zero. This lets the next
`setMode` call freely piggyback the required mode without triggering
`Rewritten`.
DeltaFile
+21-22llvm/test/CodeGen/AMDGPU/vgpr-setreg-mode-swar.mir
+5-3llvm/lib/Target/AMDGPU/AMDGPULowerVGPREncoding.cpp
+26-252 files

LLVM/project 3a16cbelldb/test/API/linux/linker-symbols TestLinkerSymbols.py

[LLDB] Skip linker symbols test on Windows and MacOS. (#184690)

The test was only intended to run on linux.

Currently it's failing on the lldb-x86_64-win builder:
https://lab.llvm.org/buildbot/#/builders/211/builds/6741
DeltaFile
+1-0lldb/test/API/linux/linker-symbols/TestLinkerSymbols.py
+1-01 files

LLVM/project cd62289llvm/lib/CodeGen/SelectionDAG SelectionDAG.cpp, llvm/test/CodeGen/X86 known-never-zero.ll

[DAG] isKnownNeverZero - add ISD::ADD/SUB DemandedElts handling and tests (#183958)

Closes #183043
DeltaFile
+53-0llvm/test/CodeGen/X86/known-never-zero.ll
+6-6llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+59-62 files

LLVM/project 7104fc1llvm/test/CodeGen/AMDGPU amdgcn.bitcast.1024bit.ll amdgcn.bitcast.512bit.ll, llvm/test/CodeGen/RISCV/rvv clmulh-sdnode.ll

Merge branch 'main' into users/vitalybuka/spr/libcxxstring-replace-asan-volatile-wrapper-with-memory-barrier
DeltaFile
+84,419-78,498llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+66,293-29,491llvm/test/CodeGen/RISCV/rvv/clmulh-sdnode.ll
+25,751-24,782llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.512bit.ll
+23,663-20,281llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.960bit.ll
+21,867-18,577llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.896bit.ll
+19,112-16,445llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.832bit.ll
+241,105-188,0741,595 files not shown
+411,183-294,8411,601 files

LLVM/project 2be726dllvm/test/DebugInfo/Generic dwarf5-debug-info-static-member.ll

[DebugInfo] Don't match wrong NULL in CHECK lines of dwarf5-debug-info-static-member.ll (#184694)

Fixes failure on clang-ppc64le-rhel buildbot
(https://lab.llvm.org/buildbot/#/builders/145/builds/13080) after
#184219.

On ppc64le, children are not produced for DW_TAG_subprogram "main" in
this test. Therefore, dwarfdump doesn't print NULL after this tag. On
other platforms (AArch64/X86), DW_TAG_subprogram has DW_TAG_variable
"instance_C", which should not be matched by the check lines.

Loosened the check lines (turned CHECK-NEXT into CHECK) to make them
work for all mentioned platforms.
DeltaFile
+4-5llvm/test/DebugInfo/Generic/dwarf5-debug-info-static-member.ll
+4-51 files

LLVM/project 89d1b4flibcxx/include string

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+21-28libcxx/include/string
+21-281 files

LLVM/project 5a88dffclang/test/CodeGen attr-target-version-riscv.c attr-target-clones-aarch64.c, clang/test/CodeGen/RISCV/ntlh-intrinsics riscv32-zihintntl.c

[Clang] Only define `wchar_size` module flag if non-standard (#184668)

Summary:
This PR simply changes the behavior of the `wchar_size` flag. Currently,
we emit this in all cases for all targets. This causes problems during
LLVM-IR linking, specifically because this would vary between Linux and
Windows in unintuitive ways. Now we have an llvm::Triple helper to
determine the size from the known values. The module flag will only be
emitted if these do not match (indicating a non-standard environment).

In addition to fixing AMDGCN bitcode linking, this also means we don't
need to bloat *every* IR module compiled by clang with this flag. The
changed tests reflects this, one less unnecessary piece of metadata.
DeltaFile
+175-175clang/test/CodeGen/RISCV/ntlh-intrinsics/riscv32-zihintntl.c
+160-162clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
+63-63clang/test/CodeGen/attr-target-version-riscv.c
+61-54clang/test/CodeGen/attr-target-clones-aarch64.c
+55-55clang/test/CodeGen/attr-target-clones-riscv.c
+54-53clang/test/CodeGenCXX/attr-target-version-riscv.cpp
+568-56296 files not shown
+1,223-1,209102 files

LLVM/project 2714583llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 split-vectorize-phi-user.ll

[SLP]Do not consider split vectorize nodes as vector phi nodes

Split vectorize nodes should not be considered as vector PHI nodes, when
trying to find the insertion point for the postpotned nodes.

Fixes #184585
DeltaFile
+80-0llvm/test/Transforms/SLPVectorizer/X86/split-vectorize-phi-user.ll
+1-0llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+81-02 files

LLVM/project 9d1b621clang-tools-extra/clang-doc JSONGenerator.cpp MDGenerator.cpp, clang-tools-extra/test/clang-doc namespace.cpp

[clang-doc] Sort index and avoid non-determinism (#184675)

Consolidate logic to get sorted children from  StringMap. 
Using the new API makes it more natural to not miss cases
where we missed sorting the children directly.

This also allows us to remove -DAG checks from tests and have
deterministic ordering.
DeltaFile
+7-10clang-tools-extra/clang-doc/JSONGenerator.cpp
+2-11clang-tools-extra/clang-doc/MDGenerator.cpp
+10-0clang-tools-extra/clang-doc/Representation.cpp
+4-5clang-tools-extra/test/clang-doc/namespace.cpp
+1-0clang-tools-extra/clang-doc/Representation.h
+24-265 files

LLVM/project 954e5e7clang/lib/CIR/CodeGen CIRGenModule.cpp CIRGenModule.h, clang/test/CIR/CodeGen replace-global.cpp

[CIR] Upstream global variable replacement (#184686)

This change upstreams the CIR implementation of global variable
replacement. When we get a call to get or create a global variable using
a type that does not match the previous type for a variable of the same
name, we need to replace the old definition with the new one. In classic
codegen that was as simple as replaceAllUses+eraseFromParent, but in CIR
because we have typed pointers, we need to visit the uses and update
them with bitcasts to reflect the new type.
DeltaFile
+46-0clang/lib/CIR/CodeGen/CIRGenModule.cpp
+37-0clang/test/CIR/CodeGen/replace-global.cpp
+4-0clang/lib/CIR/CodeGen/CIRGenModule.h
+87-03 files

LLVM/project a433372clang/lib/CodeGen CGObjCMac.cpp

remove redundent assert
DeltaFile
+0-4clang/lib/CodeGen/CGObjCMac.cpp
+0-41 files

LLVM/project fa581d4clang-tools-extra/clang-doc JSONGenerator.cpp MDGenerator.cpp

Centralize sorting logic for StringMap members
DeltaFile
+7-11clang-tools-extra/clang-doc/JSONGenerator.cpp
+2-11clang-tools-extra/clang-doc/MDGenerator.cpp
+10-0clang-tools-extra/clang-doc/Representation.cpp
+1-0clang-tools-extra/clang-doc/Representation.h
+20-224 files

LLVM/project ca0d100llvm/lib/Transforms/Vectorize VPlanTransforms.cpp

[VPlan] Use VPlan::getZero to improve code (NFC) (#184591)

DeltaFile
+7-7llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+7-71 files

LLVM/project b3a1317llvm/lib/MC MCAsmInfoGOFF.cpp

Add include
DeltaFile
+1-0llvm/lib/MC/MCAsmInfoGOFF.cpp
+1-01 files

LLVM/project 6b33c5cllvm/lib/Target/SystemZ SystemZAsmPrinter.cpp

Add back spaces
DeltaFile
+1-1llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
+1-11 files

LLVM/project ec15263lld/test/wasm weak-alias.ll weak-alias.s, lld/test/wasm/Inputs weak-alias.ll weak-alias.s

[lld][WebAssembly] Convert weak-alias tests to assembly. NFC (#184667)

This actually both improves and simplifies the `Inputs/weak_alias`. With
the `.ll` version we ended up using memory and `__stack_pointer` and
locals, but LLVM ended up generated `call` rather than `call_indirect`
for the `call_alias_ptr` and `call_direct_ptr`. With the assembly tests
we can ensure the usage of `call_indirect` while avoiding all the other
stuff.
DeltaFile
+0-303lld/test/wasm/weak-alias.ll
+268-0lld/test/wasm/weak-alias.s
+0-135lld/test/wasm/weak-alias-overide.ll
+131-0lld/test/wasm/weak-alias-overide.s
+0-39lld/test/wasm/Inputs/weak-alias.ll
+35-0lld/test/wasm/Inputs/weak-alias.s
+434-4776 files