LLVM/project 81d345f — clang/lib/AST/ByteCode InterpBuiltin.cpp, clang/test/AST/ByteCode builtin-functions.cpp

[clang][bytecode] Check __builtin_strcmp for fixed-size integer elements (#237879)

We can't call getElemDataSize() on e.g. 128-bit integers.
DeltaFile
+21-1clang/lib/AST/ByteCode/InterpBuiltin.cpp
+5-0clang/test/AST/ByteCode/builtin-functions.cpp
+26-12 files

LLVM/project 9efb947 — llvm/lib/Transforms/InstCombine InstCombineCalls.cpp, llvm/test/Transforms/InstCombine minmax-of-itofp.ll

[InstCombine] Fold min/max of int-to-fp casts into integer min/max (#237190)

When both operands of a floating-point min/max intrinsic are the same
int-to-fp cast, the min/max can be done on the integers and converted
once:
  m(uitofp X, uitofp Y) -> uitofp(umin/umax(X, Y))
  m(sitofp X, sitofp Y) -> sitofp(smin/smax(X, Y))

Integer-to-float conversion is monotonic, so it preserves the order of
the operands. This covers all six min/max intrinsics.

Alive2: https://alive2.llvm.org/ce/z/PKQyse
DeltaFile
+195-0llvm/test/Transforms/InstCombine/minmax-of-itofp.ll
+25-0llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+220-02 files

LLVM/project 44b5482 — llvm/test/CodeGen/AArch64 sve-fixed-length-masked-64-128bit-stores.ll sve-fixed-length-masked-64-128bit-loads.ll

[AArch64][NFC] Add tests for illegal fixed-width vector masked ops (#232718)
DeltaFile
+1,169-0llvm/test/CodeGen/AArch64/fixed-length-masked-loads.ll
+1,049-0llvm/test/CodeGen/AArch64/fixed-length-masked-stores.ll
+0-208llvm/test/CodeGen/AArch64/sve-fixed-length-masked-64-128bit-loads.ll
+0-187llvm/test/CodeGen/AArch64/sve-fixed-length-masked-64-128bit-stores.ll
+2,218-3954 files

LLVM/project 6604cd1 — mlir/lib/Target/SPIRV TranslateRegistration.cpp, mlir/test/Target/SPIRV serialize-emit-debug-info.mlir

[mlir][SPIR-V] Pass serialization options in --serialize-spirv (#237710)

serializeModule dropped its options, so --spirv-emit-debug-info had no
effect

---------

Co-authored-by: Igor Wodiany <dev at wodiany.com>
DeltaFile
+15-0mlir/test/Target/SPIRV/serialize-emit-debug-info.mlir
+1-1mlir/lib/Target/SPIRV/TranslateRegistration.cpp
+16-12 files

LLVM/project 49d9f27 — clang/lib/AST/ByteCode IntegralAP.h Char.h

[clang][bytecode] Resolve FIXME comment in CheckArraySize (#237860)

Add `getActiveBits()` to primitive integral types so we don't have to go
through `APSInt`.
DeltaFile
+12-13clang/lib/AST/ByteCode/InterpHelpers.h
+2-3clang/lib/AST/ByteCode/Interp.h
+5-0clang/lib/AST/ByteCode/Integral.h
+1-0clang/lib/AST/ByteCode/IntegralAP.h
+1-0clang/lib/AST/ByteCode/Char.h
+1-0clang/lib/AST/ByteCode/Boolean.h
+22-166 files

LLVM/project bf25652 — mlir/include/mlir/Dialect/XeGPU/Utils XeGPUUtils.h, mlir/lib/Conversion/XeGPUToXeVM XeGPUToXeVM.cpp

[MLIR][XeGPU] Fix memref-i4 offsets computation (#233474)

Introduces a new utility function `xegpu::addElemOffsetInBytes` for
byte-offset computation and use it in `xegpu-to-xevm` and
`peephole-optimizer`.

In comparison with the old logic, the new utility function handles
sub-byte (i4) types correctly by first multiplying the element-offset by
bit-width and dividing by 8 later:
```c++
// old logic
byteOffset = elemOffset * (bitWidth / 8);
basePtr += byteOffset;

// old logic breaks on sub-byte types:
byteOffset = 1024 * (4 / 8);  // 1024 * 0 == 0
basePtr += 0;                 // reads from the start of the buffer

// new logic in 'addElemOffsetInBytes'

    [6 lines not shown]
DeltaFile
+33-0mlir/lib/Dialect/XeGPU/Utils/XeGPUUtils.cpp
+20-0mlir/test/Dialect/XeGPU/peephole-optimize.mlir
+20-0mlir/test/Conversion/XeGPUToXeVM/materializecast.mlir
+3-11mlir/lib/Conversion/XeGPUToXeVM/XeGPUToXeVM.cpp
+2-6mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp
+7-0mlir/include/mlir/Dialect/XeGPU/Utils/XeGPUUtils.h
+85-176 files

LLVM/project 6bceb3a — clang/lib/Sema SemaOpenMP.cpp, openmp/runtime/test/worksharing/for omp_for_narrow_unsigned_iv.c

[OpenMP][clang] Correctly widen loop iteration calculation

For a loop like `for (uint32_t i = 0; i < (size_t)13; i += 2)`, widen
the `lower - step + 1` calculation to the size of the upper bound type,
aka size_t in this case. Otherwise, we would not caluclate 13 - (-1),
but instead 13 - (0xFFFFFFFF) and get the wrong result.

Fixes https://github.com/llvm/llvm-project/issues/70687.

Claude assisted with this patch.
DeltaFile
+120-0openmp/runtime/test/worksharing/for/omp_for_narrow_unsigned_iv.c
+20-0clang/lib/Sema/SemaOpenMP.cpp
+140-02 files

LLVM/project f736bb6 — llvm/include/llvm/Analysis TargetTransformInfo.h, llvm/lib/Target/AArch64 AArch64TargetTransformInfo.cpp

[AArch64][LSR] Prefer LSR solutions with less pre/post-index (#234264)

In AArch64 CPUs a pre or post indexed load/store typically uses an extra
ALU resource compared to a load/store that uses offset addressing.
Therefore in Loop Strength Reduce we should favor solutions with fewer
of these instructions when the Insns and NumRegs costs are equal.

This currently has no effect, as the preferred addressing mode for
AArch64 is None so LSR assumes pre/post index instructions don't exist,
but I'm planning on changing the addressing mode in the future.
DeltaFile
+61-17llvm/test/Transforms/LoopStrengthReduce/AArch64/prefer-all.ll
+12-5llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+9-5llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+1-0llvm/include/llvm/Analysis/TargetTransformInfo.h
+83-274 files

LLVM/project 836f3e4 — clang/docs ReleaseNotes.md, clang/lib/Lex PPExpressions.cpp

[clang][Lex] Fix assertion on unclosed paren in PP directive (#234992)

Clangd's preamble scan runs the preprocessor in single file parse mode.
If a directive contains an undefined identifier and ends inside a
subexpression (e.g. due to an unclosed parenthesis), PeekTok is already
eod when DiscardUntilEndOfDirective is called. That function lexes one
more token which is eof on the truncated buffer and triggers an
assertion.

Only discard if the current token is not eod, analogous to the other
callers of DiscardUntilEndOfDirective.

Fixes #226555
DeltaFile
+17-0clang/unittests/Lex/LexerTest.cpp
+4-1clang/lib/Lex/PPExpressions.cpp
+3-0clang/docs/ReleaseNotes.md
+24-13 files

LLVM/project f255ebf — lldb/source/Plugins/Process/wasm ProcessWasm.cpp, lldb/test/API/functionalities/gdb_remote_client TestWasm.py wasm_operating_system.py

[lldb] Read Wasm globals through a frame of the stub's own thread (#237195)

This commit fixes an unconditional cast from Thread to ThreadWasm, which
ignores the possibility of an OS plugin, by using the real thread list.

Note that using the qWasmGlobal variant that expects a frame index is
unlikely to succeed in the presence of a custom unwinder that presents a
different view of frames. But at the very least we shouldn't crash by
doing an invalid cast, which this fixes.
DeltaFile
+40-0lldb/test/API/functionalities/gdb_remote_client/wasm_operating_system.py
+25-0lldb/test/API/functionalities/gdb_remote_client/TestWasm.py
+10-10lldb/source/Plugins/Process/wasm/ProcessWasm.cpp
+75-103 files

LLVM/project 9817e0b — clang/lib/AST/ByteCode Context.cpp, clang/test/SemaCXX static-assert-cxx26.cpp

[clang][bytecode] Diagnose one-past-end pointers in evaluateStringRepr (#237882)
DeltaFile
+12-0clang/test/SemaCXX/static-assert-cxx26.cpp
+8-2clang/lib/AST/ByteCode/Context.cpp
+20-22 files

LLVM/project 392dfff — clang/docs ReleaseNotes.md

[clang] Add release note for EmitDeferred re-emission fix on 23.x
DeltaFile
+2-0clang/docs/ReleaseNotes.md
+2-01 files

LLVM/project 8db94f8 — clang/lib/CodeGen CodeGenModule.cpp, clang/test/CodeGenCXX header-unit-inline-var-double-emission.cpp

[clang][Modules] Keep existing global definition on type mismatch in GetOrCreateLLVMGlobal (#223877)

When a global is requested for definition but a definition with the same
mangled name already exists, return it as is instead of creating a fresh
global and erasing the defined one, even if its type differs from the
requested type.

The type can legitimately differ when the initializer folded to a
different (e.g. anonymous) type, as happens with unions. Erasing the
defined global dangles pointers held by callers, e.g. the
`AssociatedData` of entries in `llvm.global_ctors`, leading to a
use-after-free crash during `EmitCtorList`. This also keeps the
deferred-decls "already emitted" check sound, since it queries with
`IsForDefinition`, which must be non-destructive.

Add a header-unit regression test: an inline variable with an
anonymous-union member, constant-initialized but requiring dynamic
destructor registration, must be emitted exactly once when imported from
header units. The folded initializer has an anonymous type that differs

    [8 lines not shown]
DeltaFile
+36-0clang/test/CodeGenCXX/header-unit-inline-var-double-emission.cpp
+20-9clang/lib/CodeGen/CodeGenModule.cpp
+29-0clang/test/OpenMP/inline-var-declare-target-double-emission.cpp
+85-93 files

LLVM/project d2efbfd — flang/lib/Semantics check-omp-structure.cpp, flang/test/Semantics/OpenMP reduction-task-nowait.f90

[flang][OpenMP] Diagnose NOWAIT used with TASK REDUCTION modifier (#237326)

E.g. OpenMP 6.0 p254

> The task reduction-modifier must not appear in a reduction clause if
> the nowait clause is specified on the same construct.

Assisted-by: Codex
DeltaFile
+151-0flang/test/Semantics/OpenMP/reduction-task-nowait.f90
+8-0flang/lib/Semantics/check-omp-structure.cpp
+159-02 files

LLVM/project 896d379 — llvm/lib/Transforms/Vectorize VPlanUtils.cpp VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize/ARM mve-reg-pressure-spills.ll mve-icmpcost.ll

[VPlan] CSE DerivedIV recipes (#237321)

Trivially CSE DerivedIV recipes, making sure to hash and compare the
contained InductionKind and FPBinOp.
DeltaFile
+33-37llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll
+11-4llvm/test/Transforms/LoopVectorize/X86/masked-store-cost.ll
+4-4llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll
+8-0llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+1-1llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+57-465 files

LLVM/project b92a605 — mlir/lib/Dialect/SPIRV/IR DotProductOps.cpp, mlir/test/Dialect/SPIRV/IR availability.mlir

[mlir][SPIR-V] Require DotProductInput4x8Bit only for 4-element i8 vectors (#237711)

Other i8 vector sizes need DotProductInputAll per
SPV_KHR_integer_dot_product
DeltaFile
+10-0mlir/test/Dialect/SPIRV/IR/availability.mlir
+1-1mlir/lib/Dialect/SPIRV/IR/DotProductOps.cpp
+11-12 files

LLVM/project 7b6a8d7 — clang/lib/AST/ByteCode InterpBuiltin.cpp, clang/test/AST/ByteCode ms.cpp

[clang][bytecode] Check for function pointers in __builtin_memcmp (#237877)

They can appear here in -fms-compatibility mode.
DeltaFile
+4-1clang/test/AST/ByteCode/ms.cpp
+4-0clang/lib/AST/ByteCode/InterpBuiltin.cpp
+8-12 files

LLVM/project 23313c8 — llvm/include/llvm/Analysis InlineCost.h, llvm/lib/Analysis InlineAdvisor.cpp InlineCost.cpp

[Inliner] Change CalleeTTI -> CallerTTI (#231905)

It makes more sense to use the caller's TTI, as this way we can query
whether the instruction can be inlined into the parent function, using
state described by the caller's TTI.

For example, for AArch64 SME where a function can be in a different mode
(streaming/non-streaming), the cost-model gives different answers based
on the TTI used.

For now, we don't expect to see any changes in behaviour as there are
currently no targets where it makes different cost/inlining-decisions
based on which TTI is used.
DeltaFile
+11-11llvm/lib/Analysis/InlineCost.cpp
+8-8llvm/lib/Analysis/InlineAdvisor.cpp
+5-5llvm/lib/Transforms/IPO/SampleProfile.cpp
+5-5llvm/include/llvm/Analysis/InlineCost.h
+4-4llvm/lib/Transforms/IPO/AlwaysInliner.cpp
+3-3llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
+36-365 files not shown
+44-4411 files

LLVM/project 63869fb — llvm/lib/Transforms/IPO FunctionSpecialization.cpp, llvm/test/Transforms/FunctionSpecialization recursive-penalty.ll

[FuncSpec] Relax restrictions on code size growth (#196570)

This patch is a preparation for
https://github.com/llvm/llvm-project/pull/195886 , which affects code
size and thus causes more functions to be rejected by the current code
size growth restriction in function specialisation.
DeltaFile
+3-3llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
+1-1llvm/test/Transforms/FunctionSpecialization/recursive-penalty.ll
+4-42 files

LLVM/project 1a9005c — flang/lib/Parser openmp-parsers.cpp

Add missing stylized instantiations
DeltaFile
+6-4flang/lib/Parser/openmp-parsers.cpp
+6-41 files

LLVM/project 03424a8 — flang/test/Semantics/OpenMP metadirective-declare-reduction-v52.f90 metadirective-declare-reduction-v51.f90

Change plus to + in two tests
DeltaFile
+4-1flang/test/Semantics/OpenMP/metadirective-declare-reduction-v52.f90
+4-1flang/test/Semantics/OpenMP/metadirective-declare-reduction-v51.f90
+8-22 files

LLVM/project 9a7cf0d — flang/test/Semantics/OpenMP metadirective-declare-reduction-v52.f90 metadirective-declare-reduction-v51.f90

Add checks for DECLARE_REDUCTION in DEFAULT/OTHERWISE
DeltaFile
+14-0flang/test/Semantics/OpenMP/metadirective-declare-reduction-v52.f90
+14-0flang/test/Semantics/OpenMP/metadirective-declare-reduction-v51.f90
+28-02 files

LLVM/project 5adc52a — flang/test/Semantics/OpenMP metadirective-declare-reduction-v52.f90 metadirective-declare-reduction-v51.f90

Add metadirective nothing per reviewer request
DeltaFile
+1-0flang/test/Semantics/OpenMP/metadirective-declare-reduction-v52.f90
+1-0flang/test/Semantics/OpenMP/metadirective-declare-reduction-v51.f90
+2-02 files

LLVM/project d6caac1 — flang/lib/Semantics check-omp-variant.cpp openmp-utils.cpp

format
DeltaFile
+2-2flang/lib/Semantics/openmp-utils.cpp
+0-1flang/lib/Semantics/check-omp-variant.cpp
+2-32 files

LLVM/project 5126244 — flang/lib/Semantics canonicalize-omp.cpp, flang/test/Semantics/OpenMP metadirective-common.f90 metadirective-declare-reduction-v52.f90

Treat ERROR AT(COMPILATION) as neutral
DeltaFile
+29-9flang/lib/Semantics/canonicalize-omp.cpp
+20-0flang/test/Semantics/OpenMP/metadirective-declare-reduction-v52.f90
+20-0flang/test/Semantics/OpenMP/metadirective-declare-reduction-v51.f90
+7-0flang/test/Semantics/OpenMP/metadirective-common.f90
+76-94 files

LLVM/project c20dd08 — flang/lib/Semantics openmp-utils.cpp

Add missing include
DeltaFile
+1-0flang/lib/Semantics/openmp-utils.cpp
+1-01 files

LLVM/project 8513b30 — flang/include/flang/Semantics openmp-utils.h, flang/lib/Semantics check-omp-variant.cpp openmp-utils.cpp

Verify selectorless clauses as well
DeltaFile
+35-20flang/lib/Semantics/openmp-utils.cpp
+9-15flang/lib/Semantics/check-omp-variant.cpp
+8-2flang/test/Semantics/OpenMP/metadirective-declare-reduction.f90
+5-0flang/include/flang/Semantics/openmp-utils.h
+57-374 files

LLVM/project 4d7b0ef — flang/lib/Semantics check-omp-variant.cpp, flang/test/Semantics/OpenMP metadirective-declare-reduction.f90 metadirective-declare-reduction-v51.f90

Address review comments
DeltaFile
+0-15flang/test/Semantics/OpenMP/metadirective-declare-reduction.f90
+15-0flang/test/Semantics/OpenMP/metadirective-declare-reduction-v51.f90
+15-0flang/test/Semantics/OpenMP/metadirective-declare-reduction-v52.f90
+1-1flang/lib/Semantics/check-omp-variant.cpp
+31-164 files

LLVM/project 38b547d — flang/lib/Semantics canonicalize-omp.cpp, flang/test/Semantics/OpenMP metadirective-declare-reduction-v52.f90 metadirective-declare-reduction-v51.f90

Missing AT is equivalent to AT(COMPILATION)
DeltaFile
+8-0flang/test/Semantics/OpenMP/metadirective-declare-reduction-v52.f90
+8-0flang/test/Semantics/OpenMP/metadirective-declare-reduction-v51.f90
+1-0flang/lib/Semantics/canonicalize-omp.cpp
+17-03 files

LLVM/project e16f9fd — flang/lib/Semantics check-omp-structure.h check-omp-structure.cpp, flang/test/Semantics/OpenMP metadirective-declare-reduction.f90

Verify DECLARE_REDUCTION in METADIRECTIVE
DeltaFile
+13-0flang/lib/Semantics/check-omp-variant.cpp
+7-2flang/lib/Semantics/check-omp-structure.cpp
+9-0flang/test/Semantics/OpenMP/metadirective-declare-reduction.f90
+1-0flang/lib/Semantics/check-omp-structure.h
+30-24 files