LLVM/project c192e8cllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 lhs-constant-non-cummutative.ll

[SLP] Fix misvectorization in commutative to non-commutative conversion (#185230)

**Summary**
Fixes a miscompilation where commutative operations (e.g., or, and, mul)
with a left-hand side constant were incorrectly transformed into
non-commutative operations (e.g., shl, sub).

**The Problem**
In `BinOpSameOpcodeHelper::getOperand`, when a constant is at `Pos ==
0`, the helper was failing to swap operand order for new non-commutative
target opcodes. This resulted in inverted logic, such as transforming
`or 0, %x` into `shl 0, %x` (resulting in 0) instead of the correct `%x
<< 0`.

**The Fix**
The existing logic only protected the Sub opcode. This patch generalizes
the fix to all non-commutative instructions by using
`!Instruction::isCommutative(ToOpcode)`. This ensures that for any
directional operation, the variable is correctly placed on the LHS and

    [9 lines not shown]
DeltaFile
+39-0llvm/test/Transforms/SLPVectorizer/X86/lhs-constant-non-cummutative.ll
+4-6llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+43-62 files

LLVM/project 9062a02lldb/source/Core PluginManager.cpp

[lldb] Temporarily remove the assert to unblock the bots (#185505)

The assert is triggering from Dexter in the cross-project-test. This
temporarily removes the assert while I address the issue.
DeltaFile
+1-3lldb/source/Core/PluginManager.cpp
+1-31 files

LLVM/project 48e6adcmlir/include/mlir/Interfaces SideEffectInterfaces.h, mlir/lib/Transforms CSE.cpp

[RFC][mlir] Resource hierarchy for MLIR Side Effects. (#181229)

This patch allows creating a hierarchy of `SideEffects::Resource`s by adding
a virtual `getParent()` method, so that effects on *disjoint* resources
can be proven non-conflicting. It also adds virtual `isAddressable()` method
that represents a property of a resource to be addressable via a pointer
value. The non-addressable resources may not be affected via any pointer.
This is unblocking CSE, LICM and alias analysis without per-pass
special-casing.

RFC:
https://discourse.llvm.org/t/rfc-mlir-memory-region-hierarchy-for-mlir-side-effects/89811
DeltaFile
+123-0mlir/unittests/Interfaces/SideEffectInterfacesTest.cpp
+93-13mlir/include/mlir/Interfaces/SideEffectInterfaces.h
+78-0mlir/test/Transforms/cse.mlir
+59-3mlir/test/lib/Dialect/Test/TestOps.h
+22-2mlir/lib/Transforms/CSE.cpp
+24-0mlir/test/Analysis/test-alias-analysis-modref.mlir
+399-188 files not shown
+469-2714 files

LLVM/project 2c1594aclang-tools-extra/test/clang-tidy check_clang_tidy.py, clang-tools-extra/test/clang-tidy/checkers/bugprone dangling-handle.cpp

[clang-tidy][NFC] Implicitly add checkers/Inputs/Headers as system headers in tests (#185442)
DeltaFile
+5-7clang-tools-extra/test/clang-tidy/checkers/performance/move-constructor-init.cpp
+8-0clang-tools-extra/test/clang-tidy/check_clang_tidy.py
+2-5clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-print-absl.cpp
+2-5clang-tools-extra/test/clang-tidy/checkers/bugprone/dangling-handle.cpp
+2-5clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format-custom.cpp
+3-3clang-tools-extra/test/clang-tidy/checkers/modernize/use-trailing-return-type-transform-lambdas.cpp
+22-2582 files not shown
+115-15888 files

LLVM/project c182ca3lldb/source/Plugins/DynamicLoader/Hexagon-DYLD DynamicLoaderHexagonDYLD.cpp, lldb/source/Plugins/DynamicLoader/POSIX-DYLD DynamicLoaderPOSIXDYLD.cpp

[lldb] Assert & fix missing calls to UnregisterPlugin (#185162)

Fix missing calls to UnregisterPlugin and add an assert in the
PluginManager that ensures all plugins have been unregistered by the
time the plugin manager is destroyed.
DeltaFile
+4-1lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
+3-1lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
+3-1lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+3-1lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
+4-0lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp
+0-4lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+17-814 files not shown
+41-2020 files

LLVM/project 78b9769llvm/test/Analysis/DependenceAnalysis weak-crossing-siv-addrec-wrap.ll

fix testcase
DeltaFile
+3-4llvm/test/Analysis/DependenceAnalysis/weak-crossing-siv-addrec-wrap.ll
+3-41 files

LLVM/project 3e2069dllvm/test/CodeGen/MIR/Generic prefetch-targets-error.mir prefetch-targets.mir

Fix https://lab.llvm.org/buildbot/#/builders/154/builds/28782
DeltaFile
+0-4llvm/test/CodeGen/MIR/Generic/prefetch-targets-error.mir
+0-1llvm/test/CodeGen/MIR/Generic/prefetch-targets.mir
+0-52 files

LLVM/project d0e066allvm/lib/Analysis DependenceAnalysis.cpp

address code style issues
DeltaFile
+2-2llvm/lib/Analysis/DependenceAnalysis.cpp
+2-21 files

LLVM/project 19d672cllvm/include/llvm/Analysis DependenceAnalysis.h, llvm/lib/Analysis DependenceAnalysis.cpp

[DA] Require 'nsw' for AddRecs in the WeakCrossing SIV test
DeltaFile
+15-7llvm/test/Analysis/DependenceAnalysis/weak-crossing-siv-addrec-wrap.ll
+11-7llvm/lib/Analysis/DependenceAnalysis.cpp
+2-4llvm/include/llvm/Analysis/DependenceAnalysis.h
+2-2llvm/test/Analysis/DependenceAnalysis/WeakCrossingSIV.ll
+30-204 files

LLVM/project 3e9808bcompiler-rt/lib/scudo/standalone primary64.h

[scudo] Use a fixed format for the milliseconds in latest release. (#185097)
DeltaFile
+1-1compiler-rt/lib/scudo/standalone/primary64.h
+1-11 files

LLVM/project 19a31b2llvm/lib/Transforms/Vectorize VectorCombine.cpp, llvm/test/Transforms/VectorCombine arbitrary-precision-int.ll

[VectorCombine] Fixing bitcast processing in VectorCombine (#185075)

Fixing bitcast instruction processing in VectorCombine pass
that operates: arbitrary precision integer types.
DeltaFile
+19-0llvm/test/Transforms/VectorCombine/arbitrary-precision-int.ll
+4-2llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+23-22 files

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

Merge branch 'main' of https://github.com/llvm/llvm-project into res-in-structs-sema
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,0743,740 files not shown
+518,091-330,8883,746 files

LLVM/project cf8a91eclang/include/clang/Options Options.td, clang/lib/Basic/Targets WebAssembly.cpp WebAssembly.h

[WebAssembly] Clang support for acquire-release atomics (#184901)

Add the feature to the clang target, including driver flags and
preprocessor defines.
DeltaFile
+12-0clang/test/Preprocessor/wasm-target-features.c
+12-0clang/lib/Basic/Targets/WebAssembly.cpp
+6-0clang/test/Driver/wasm-features.c
+2-0clang/include/clang/Options/Options.td
+1-0clang/lib/Basic/Targets/WebAssembly.h
+33-05 files

LLVM/project 4aa1f21llvm/include/llvm/Support UniqueBBID.h, llvm/lib/CodeGen MIRPrinter.cpp

Centralize prefetch target storage in MachineFunction. (#184194)

### Prefetch Symbol Resolution

Based on this
[suggestion](https://discourse.llvm.org/t/rfc-code-prefetch-insertion/88668/29?u=rlavaee),
we must identify if a prefetch target is defined in the current module
to avoid **undefined symbol errors**. Since this occurs during
sequential **CodeGen**, we must rely on function names rather than IR
Module APIs.

**Key Changes:**
* **`MachineFunction` Integration:** Added a `PrefetchTargets` field
(with serialization) to track all targets associated with a function.
* **Guaranteed Emission:** All prefetch targets are now emitted
regardless of basic block or callsite index matches to ensure the symbol
exists.
* **Fallback Placement:** Targets with non-matching callsite indices are
emitted at the end of the block to resolve the reference.
DeltaFile
+57-23llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+43-12llvm/lib/CodeGen/MIRParser/MIParser.cpp
+43-0llvm/test/CodeGen/MIR/Generic/prefetch-targets-error.mir
+26-3llvm/lib/CodeGen/MIRParser/MIRParser.cpp
+15-4llvm/include/llvm/Support/UniqueBBID.h
+17-0llvm/lib/CodeGen/MIRPrinter.cpp
+201-429 files not shown
+253-7015 files

LLVM/project 0ab9053llvm/lib/Target/AMDGPU AMDGPUAttributor.cpp AMDGPU.h

[AMDGPU] Cgscc amdgpu attributor boilerplate NFC (#179719)

This PR is adding a boilerplate of CGSCC AMDGPUAttributor pass
(amdgpu-attributor-cgscc) by doing refactoring from the existing Module
AMDGPUAttributor pass (amdgpu-attributor).

CGSCC AMDGPUAttributor pass sets `AttributorConfig.IsModulePass =
false`, and make Attributor's `Functions` set contain only functions in
a SCC.
The main implementations of abstract attributes have not changed - NFC. 

Subsequently, in future work some of the AMDGPU abstract attributors
might move to be handled by CGSCC pass.

---------

Co-authored-by: Matt Arsenault <arsenm2 at gmail.com>
DeltaFile
+42-10llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
+13-0llvm/lib/Target/AMDGPU/AMDGPU.h
+11-0llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+6-0llvm/lib/Target/AMDGPU/AMDGPUPassRegistry.def
+72-104 files

LLVM/project 13440aeclang-tools-extra/clang-doc/benchmarks ClangDocBenchmark.cpp

[clang-doc] Fix wrong type name for Serializer in benchmark (#185493)
DeltaFile
+1-1clang-tools-extra/clang-doc/benchmarks/ClangDocBenchmark.cpp
+1-11 files

LLVM/project e645bb3clang/lib/CIR/CodeGen CIRGenExprConstant.cpp, clang/test/CIR/CodeGen pointer-to-data-member.cpp

[CIR] Fix codegen for MemberPoint with nullptr value (#185309)

Fix codegen for the MemberPoint with a nullptr value
DeltaFile
+6-0clang/test/CIR/CodeGen/pointer-to-data-member.cpp
+3-0clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
+9-02 files

LLVM/project f70db52flang/include/flang/Semantics tools.h, flang/lib/Semantics tools.cpp check-call.cpp

[flang][cuda] Relax host intrinsic semantic check in acc routine (#185483)

Semantic check that checks if any actual argument is on the device
doesn't need to be active in acc routine function/subroutine.
DeltaFile
+20-1flang/test/Semantics/cuf23.cuf
+13-0flang/lib/Semantics/tools.cpp
+3-1flang/lib/Semantics/check-call.cpp
+1-0flang/include/flang/Semantics/tools.h
+37-24 files

LLVM/project 9879df9clang/test/CIR/CodeGenOpenACC private-clause-pointer-array-recipes-CtorDtor.cpp compute-reduction-clause-default-ops.cpp, clang/test/CIR/IR cmp.cir

[CIR] Change CmpOp assembly format to use bare keyword style (#185114)

Update the assembly format of cir.cmp from the parenthesized style
  `cir.cmp(gt, %a, %b) : !s32i, !cir.bool`
to the bare keyword style used by other CIR ops like cir.cast:
  `cir.cmp gt %a, %b : !s32i`

The result type (!cir.bool) is now automatically inferred as it is
always cir::BoolType.
DeltaFile
+64-64clang/test/CIR/CodeGenOpenACC/private-clause-pointer-array-recipes-CtorDtor.cpp
+60-60clang/test/CIR/IR/cmp.cir
+57-57clang/test/CIR/CodeGenOpenACC/compute-reduction-clause-default-ops.cpp
+57-57clang/test/CIR/CodeGenOpenACC/loop-reduction-clause-default-ops.cpp
+57-57clang/test/CIR/CodeGenOpenACC/compute-reduction-clause-default-ops.c
+57-57clang/test/CIR/CodeGenOpenACC/combined-reduction-clause-default-ops.cpp
+352-35282 files not shown
+1,334-1,30888 files

LLVM/project 66137fellvm/lib/Target/AArch64 AArch64ISelLowering.cpp AArch64InstrInfo.td, llvm/test/CodeGen/AArch64 f16f32dot-fixed-length-fdot.ll sve2p1-fixed-length-fdot.ll

[AArch64] Add partial reduce patterns for new fdot instructions (#184659)

This patch enables generation of new dot instruction added in under
FEAT_F16F32DOT from partial reduce nodes.
DeltaFile
+30-0llvm/test/CodeGen/AArch64/f16f32dot-fixed-length-fdot.ll
+27-0llvm/test/CodeGen/AArch64/sve2p1-fixed-length-fdot.ll
+9-0llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+1-1llvm/lib/Target/AArch64/AArch64InstrInfo.td
+67-14 files

LLVM/project c700a00clang/lib/Sema SemaHLSL.cpp HLSLBuiltinTypeDeclBuilder.cpp, clang/test/AST/HLSL Texture2D-shorthand-AST.hlsl

[HLSL] Implement Texture2D default template (#184207)

The Texture2D type has a default template of float4. This can be written
in a couple way: `Texture2D<>` or `Texture2D`. This must be implemented
for consistenty with DXC in HLSL202x.

To implement `Texture2D<>` we simply add a default type for the template
parameter.

To implement `Texture2D`, we have to add a special case for a template
type without a template instantiation. For HLSL, we check if it is a
texture type. If so, the default type is filled in.

Note that HLSL202x does not support C++17 Class Template Argument
Deduction, so we cannot use that feature to give us `Texture2D`.

See https://github.com/llvm/wg-hlsl/pull/386 for alternatives that were
considered.


    [13 lines not shown]
DeltaFile
+48-0clang/lib/Sema/SemaHLSL.cpp
+44-0clang/test/SemaHLSL/BuiltIns/RWStructuredBuffers.hlsl
+39-0clang/test/AST/HLSL/Texture2D-shorthand-AST.hlsl
+31-0clang/test/CodeGenHLSL/resources/Texture2D-shorthand-contexts.hlsl
+27-0clang/test/CodeGenHLSL/resources/Texture2D-default-explicit-binding.hlsl
+16-5clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.cpp
+205-58 files not shown
+284-614 files

LLVM/project 5cafc12clang/test/Analysis/Scalable/ssaf-linker/Inputs tu-2.json tu-1.json, clang/test/Analysis/Scalable/ssaf-linker/Outputs lu-1+2.json lu-2.json

[clang][ssaf] Implement Entity Linker CLI and patching for JSON Format

This PR implements Entity ID patching for the JSON serialization format
and introduces `ssaf-linker`, a command-line tool that drives the
`EntityLinker`.

1. Entity ID references inside summary blobs use the sentinel
representation `{"@": <uint64>}`. Patching walks the JSON value tree
recursively, recognizes sentinels, and rewrites their indices using the
`EntityResolutionTable` provided by the linker.
2. An object with an `@` key but extra keys `(size != 1)`, an `@` value
that is not a valid `uint64`, and an entity ID not present in the
resolution table, lead to patching errors.
3. `JSONFormat::EntityIdConverter` is replaced with two `function_ref`
typedefs to eliminate the wrapper class.
4.`ssaf-linker` is implemented in `clang/tools/ssaf-linker/` and gets
built at `bin/ssaf-linker`.
5. lit tests check CLI, verbose output, timing output, validation
errors, I/O errors, linking errors, and successful linking.

rdar://162570931
DeltaFile
+652-0clang/test/Analysis/Scalable/ssaf-linker/Outputs/lu-1+2.json
+370-0clang/test/Analysis/Scalable/ssaf-linker/Outputs/lu-2.json
+364-0clang/test/Analysis/Scalable/ssaf-linker/Outputs/lu-1.json
+352-0clang/test/Analysis/Scalable/ssaf-linker/Inputs/tu-2.json
+346-0clang/test/Analysis/Scalable/ssaf-linker/Inputs/tu-1.json
+329-0clang/tools/ssaf-linker/SSAFLinker.cpp
+2,413-039 files not shown
+3,115-10645 files

LLVM/project 7dbd143llvm/lib/Transforms/Vectorize SLPVectorizer.cpp

Fix comment

Created using spr 1.3.7
DeltaFile
+1-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+1-11 files

LLVM/project a6bd72fllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 bswap-i64-by-i32-chunks.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+42-4llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+5-14llvm/test/Transforms/SLPVectorizer/X86/bswap-i64-by-i32-chunks.ll
+47-182 files

LLVM/project 298ef51clang/lib/CIR/CodeGen CIRGenExprAggregate.cpp, clang/test/CIR/CodeGen instantiate-init.cpp

[CIR] Add support for CXXStdInitializerListExpr (#185279)

Add support for the CXXStdInitializerListExpr
DeltaFile
+105-0clang/test/CIR/CodeGen/instantiate-init.cpp
+49-2clang/lib/CIR/CodeGen/CIRGenExprAggregate.cpp
+154-22 files

LLVM/project 3671fadmlir/lib/Dialect/OpenACC/Utils OpenACCUtilsLoop.cpp, mlir/unittests/Dialect/OpenACC OpenACCUtilsLoopTest.cpp

[mlir][OpenACC] Normalize loop bounds in convertACCLoopToSCFFor for negative steps (#184935)

`convertACCLoopToSCFFor` was passing `acc.loop` bounds directly to
`scf.for`, which produces an `scf.for` with a negative step when the
source is a Fortran DO loop counting down (e.g. `DO k = n, 1, -1`).
Since `scf.for` requires a positive step, this generated invalid IR that
caused downstream crashes during LLVM lowering.

`convertACCLoopToSCFParallel` already normalizes all loops
unconditionally to `lb=0, step=1, ub=tripCount`, but
`convertACCLoopToSCFFor` did not. This patch applies the same
normalization to `convertACCLoopToSCFFor`, with IV denormalization in
the loop body (`original_iv = normalized_iv * orig_step + orig_lb`), and
lets later passes fold away constants.
DeltaFile
+31-45mlir/lib/Dialect/OpenACC/Utils/OpenACCUtilsLoop.cpp
+55-19mlir/unittests/Dialect/OpenACC/OpenACCUtilsLoopTest.cpp
+86-642 files

LLVM/project 7a85921libc/src/string strncmp.cpp strcmp.cpp, libc/test/src/string strcoll_test.cpp strncmp_test.cpp

[libc] Use unsigned char in strcmp, strncmp, and strcoll comparisons (#185393)

According to section 7.24.1 of the C standard, character comparison in
string functions must be performed as if the characters had the type
`unsigned char`.

The previous implementations of `strcmp`, `strncmp`, and `strcoll` were
doing a direct subtraction of `char` values. On platforms where `char`
is signed, this resulted in incorrect negative values being returned
when characters exceeding 127 were being compared.

This patch fixes the comparison functions to explicitly cast the
character values to `unsigned char` prior to computing their difference.
It also adds regression tests to ensure the comparison behaves correctly
for ASCII values greater than 127.
DeltaFile
+7-0libc/test/src/string/strcoll_test.cpp
+7-0libc/test/src/string/strncmp_test.cpp
+7-0libc/test/src/string/strcmp_test.cpp
+4-1libc/src/string/strncmp.cpp
+3-1libc/src/string/strcmp.cpp
+1-1libc/src/string/strcoll.cpp
+29-36 files

LLVM/project 76daf31llvm/lib/Target/AMDGPU AMDGPULowerKernelAttributes.cpp, llvm/lib/Target/AMDGPU/Utils AMDGPUBaseInfo.h AMDGPUBaseInfo.cpp

AMDGPU: Annotate group size ABI loads with range metadata (#185420)

We previously did the same for the grid size when annotated.
The group size is easier, so it's weird that this wasn't implemented
first.
DeltaFile
+122-15llvm/test/CodeGen/AMDGPU/implicit-arg-v5-opt.ll
+48-19llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp
+8-7llvm/test/CodeGen/AMDGPU/amdgpu-max-num-workgroups-load-annotate.ll
+8-7llvm/test/CodeGen/AMDGPU/implicit-arg-block-count.ll
+5-2llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
+0-5llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+191-552 files not shown
+193-578 files

LLVM/project f1a2fd2clang/lib/CodeGen CGExprScalar.cpp, clang/test/CodeGenHLSL/BasicFeatures MatrixElementTypeCast.hlsl

[HLSL][Matrix] Make HLSLElementwiseCast respect matrix memory layout (#184429)

Fixes #184379

Changes the implementation of HLSLElementwiseCast to respect matrix
memory layout.
The new implementation reads from the `LoadList` array in row-major
order as opposed to column-major in the old implementation, which makes
more sense because `LoadList` is always interpreted in row-major order
when read as a matrix.
The writes to the allocation `V` for the destination matrix now respects
the default matrix memory layout.

Assisted-by: claude-opus-4.6
DeltaFile
+38-22clang/test/CodeGenHLSL/BasicFeatures/MatrixElementTypeCast.hlsl
+19-13clang/lib/CodeGen/CGExprScalar.cpp
+57-352 files

LLVM/project d3a22eaclang/lib/CIR/Dialect/Transforms FlattenCFG.cpp, clang/test/CIR/CodeGen virtual-fn-calls-eh.cpp virtual-function-calls.cpp

[CIR] Fix try_call replacement for indirect calls (#185095)

We had a bug in the FlattenCFG pass where if an indirect call occurred
within a cleanup scope that required exception handling, the indirect
callee was not being preserved in the cir.try_call. This fixes that.
DeltaFile
+124-0clang/test/CIR/CodeGen/virtual-fn-calls-eh.cpp
+49-0clang/test/CIR/Transforms/flatten-try-op.cir
+47-0clang/test/CIR/CodeGen/virtual-function-calls.cpp
+17-6clang/lib/CIR/Dialect/Transforms/FlattenCFG.cpp
+237-64 files