LLVM/project fc9f8ecllvm/lib/Transforms/Vectorize VPlanUtils.h VPlanUtils.cpp, llvm/test/Transforms/LoopVectorize/X86 cost-model.ll

[VPlan] Expand sequential/regular UMin SCEVs in VPSCEVExpander. (#209786)

Add support for expanding SequentialUMinExpr SCEV expressions in
VPSCEVExpander.

For regular UMin expressions, the expansion unconditionally expands &
executes all operands, while the semantics of sequential UMin only
require the first operand to be evaluated unconditionally.

For sequential UMin expressions, we need to make sure potentially
UB/poison generating operands must be accounted for. Matching IR SCEV
expander, make sure that divisors of UDiv are poison-free and non-zero
inside sequential UMin. Similarly, freeze all operands other than the
first, to avoid poison from propagating.

PR: https://github.com/llvm/llvm-project/pull/209786
DeltaFile
+33-7llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+4-0llvm/lib/Transforms/Vectorize/VPlanUtils.h
+2-1llvm/test/Transforms/LoopVectorize/X86/cost-model.ll
+39-83 files

LLVM/project 4f1d586llvm/lib/Target/RISCV RISCVPassRegistry.def RISCVTargetMachine.cpp, llvm/test/CodeGen/RISCV postra-expand-pseudo.mir

[RISCV] Port Post-RA Expand Pseudos to NewPM (#218080)

Assisted-by: AI
DeltaFile
+50-26llvm/lib/Target/RISCV/RISCVPostRAExpandPseudoInsts.cpp
+27-0llvm/test/CodeGen/RISCV/postra-expand-pseudo.mir
+9-2llvm/lib/Target/RISCV/RISCV.h
+2-2llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+1-1llvm/tools/llvm-exegesis/lib/RISCV/Target.cpp
+2-0llvm/lib/Target/RISCV/RISCVPassRegistry.def
+91-313 files not shown
+94-329 files

LLVM/project 0008a69llvm/lib/Transforms/Scalar InferAddressSpaces.cpp, llvm/test/Transforms/InferAddressSpaces/AMDGPU phi-cycle-uninitialized-addrspace.ll

[InferAddressSpaces] Lower stuck uninitialized values to flat before rewriting (#215525)
DeltaFile
+272-0llvm/test/Transforms/InferAddressSpaces/AMDGPU/phi-cycle-uninitialized-addrspace.ll
+64-25llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
+336-252 files

LLVM/project 1411f47llvm/lib/Target/DirectX DXIL.td DXILOpLowering.cpp, llvm/test/CodeGen/DirectX CreateHandleHeap.ll CreateHandleHeap-NURI.ll

[DirectX] Lower `llvm.dx.resource.handlefromheap` intrinsic (#216459)

Add lowering of `llvm.dx.resource.handlefromheap` intrinsic. It gets
translated to DXIL ops `createHandleFromHeap` and `annotateHandle`.

For example, the intrinsic call

```llvm
%typed = call target("dx.TypedBuffer", <4 x float>, 1, 0, 0)
    @llvm.dx.resource.handlefromheap.tdx.TypedBuffer_v4f32_1_0_0(i32 3)
```

will lower to

```llvm
%0 = call %dx.types.Handle @dx.op.createHandleFromHeap(i32 218, i32 3, i1 false, i1 false)
%1 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %0,
         %dx.types.ResourceProperties { i32 4106, i32 1033 })
```

    [4 lines not shown]
DeltaFile
+46-0llvm/lib/Target/DirectX/DXILOpLowering.cpp
+32-0llvm/test/CodeGen/DirectX/CreateHandleHeap.ll
+32-0llvm/test/CodeGen/DirectX/CreateHandleHeap-NURI.ll
+8-0llvm/lib/Target/DirectX/DXIL.td
+118-04 files

LLVM/project 05819ffllvm/lib/Analysis ValueTracking.cpp, llvm/test/Transforms/InstSimplify urem-sub-nonzero.ll

[InstSimplify] Simplify nonzero comparisons involving X urem Y via X u>= Y (#216072)

This teaches ValueTracking that `X` and `X urem Y` are non-equal when a
dominating condition implies `X u>= Y`.

It also handles cases where `X u>= Y` can be proven structurally, such
as when `X` is an `add nuw` of `A` and `Y`.

For a defined `urem`, let `R = X urem Y`. Then:

```text
R == X  <=>  X u< Y
R != X  <=>  X u>= Y
```

This allows InstSimplify's existing nonzero reasoning to simplify
comparisons equivalent to `(X - R) != 0`, including:

- `(X - R) u>= 1` and `(X - R) u< 1`

    [8 lines not shown]
DeltaFile
+412-0llvm/test/Transforms/InstSimplify/urem-sub-nonzero.ll
+22-0llvm/lib/Analysis/ValueTracking.cpp
+434-02 files

LLVM/project ef22de8llvm/include/llvm/Transforms/Coroutines CoroShape.h, llvm/lib/Transforms/IPO AttributorAttributes.cpp

[Transforms] Remove dead declarations (#218110)

initABI: The corresponding function definition was removed on October 3,
2024 in commit 66227bf7ee2cd674e0306d9a1e9f1d86bc75123f.

AccessAsInstructionInfo: The last use was removed on March 8, 2022 in
commit e8fadafe774c7e601129be50cedce1dd20843cea.
DeltaFile
+0-9llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+0-2llvm/include/llvm/Transforms/Coroutines/CoroShape.h
+0-112 files

LLVM/project a4402bdmlir/lib/Bindings/Python IRCore.cpp, mlir/lib/CAPI/IR ExtensibleDialect.cpp

[MLIR][Python] Add effect and speculatability specifiers for Python-defined ops (#216773)

This PR adds standalone effect and speculatability specifiers for
Python-defined operations.

`NoMemoryEffect` and `AlwaysSpeculatable`, previously nested under
`Pure`, are now public, and `RecursivelySpeculatable` is added. `Pure`
remains a shorthand for attaching `NoMemoryEffect` and
`AlwaysSpeculatable`.

This also exposes `OpTrait::HasRecursiveMemoryEffects` through the C API
and Python bindings as `ir.RecursiveMemoryEffectsTrait`, allowing
region-bearing Python-defined operations to derive their memory effects
from nested operations:

```python
class LeafOp(
    TestDialect.Operation,
    name="leaf",

    [22 lines not shown]
DeltaFile
+494-0mlir/test/python/ir/memory_effects_op_interface.py
+0-357mlir/test/python/dialects/memory_effects_op_interface.py
+71-0mlir/test/python/dialects/ext.py
+48-9mlir/lib/Bindings/Python/IRCore.cpp
+37-16mlir/python/mlir/dialects/ext.py
+15-0mlir/lib/CAPI/IR/ExtensibleDialect.cpp
+665-3822 files not shown
+682-3828 files

LLVM/project 6e294bcclang-tools-extra/clang-tidy/readability TrailingCommaCheck.cpp, clang-tools-extra/docs ReleaseNotes.md

[clang-tidy] Fix false positives in readability-trailing-comma for designated initializers (#215934)

The problem is that we delete the necessary comma whenever we use
implicit initializer lists. How we solve this is that whenever we see an
implicit initializer list, we do not match ``InitListExpr`` nodes at
all, so that we will not delete the necessary comma. Why we chose this
path is detailed in Alternatives considered.

This produces a fix that breaks valid code (#214087) and one that never
converges (#214086).

<details>
<summary><b>Alternatives considered</b></summary>

### Why not repair the source ranges instead

The synthesized nodes also carry misleading locations - their range is a
snapshot of the designator that caused them to be created, so it need
not cover their own children. The anonymous-struct node in #214087

    [38 lines not shown]
DeltaFile
+119-0clang-tools-extra/test/clang-tidy/checkers/readability/trailing-comma-cxx20.cpp
+51-0clang-tools-extra/test/clang-tidy/checkers/readability/trailing-comma.c
+6-0clang-tools-extra/docs/ReleaseNotes.md
+2-1clang-tools-extra/clang-tidy/readability/TrailingCommaCheck.cpp
+178-14 files

LLVM/project 505bb64clang/include/clang/Options Options.td

[clang-cl] Fix help string output for `/experimental:deterministic` option. NFC (#207083)

The `clang-cl -help` command show the help string for
`/experimental:deterministic` options with the default metavar name
value that should not be:

  /experimental:deterministic<value>

This patch fixes this output and omits the `<value>` part for the
option.
DeltaFile
+1-1clang/include/clang/Options/Options.td
+1-11 files

LLVM/project 503b56cclang/include/clang/Basic CodeGenOptions.h, clang/lib/Basic CodeGenOptions.cpp

[DebugInfo][CodeView] Emit path prefix substitution for COFF object file name. (#205729)

The `S_OBJNAME` field value gets by bypassing `CGDebugInfo` and its path
prefix does not get remapped if requested `fdebug-prefix-map=` option as
the other pathes in the debug info. This patch fixes it and does
remapping for the object file path either.
DeltaFile
+10-0clang/lib/Basic/CodeGenOptions.cpp
+9-0clang/test/DebugInfo/Generic/codeview-buildinfo.c
+1-5clang/lib/CodeGen/CGDebugInfo.cpp
+4-0clang/include/clang/Basic/CodeGenOptions.h
+2-1clang/lib/CodeGen/BackendUtil.cpp
+26-65 files

LLVM/project 90331e0llvm/utils/gn/secondary/lldb/source/Plugins/Language/CPlusPlus BUILD.gn

[gn build] Port b8193ac24fe8 (#218134)
DeltaFile
+1-0llvm/utils/gn/secondary/lldb/source/Plugins/Language/CPlusPlus/BUILD.gn
+1-01 files

LLVM/project ef65e82libc/src/__support/FPUtil CMakeLists.txt

fix self dependency
DeltaFile
+1-1libc/src/__support/FPUtil/CMakeLists.txt
+1-11 files

LLVM/project 36c3b79llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/AMDGPU fma-operand-contract-selection.ll

[SLP] Fix canConvertToFMA fmul costing (#216425)

Price the unfused fmul without a context instruction. Targets that model
fma fusion price a contractable fmul as free, which discounted the
scalar side of the comparison too and fmuladd never looked profitable.
DeltaFile
+36-6llvm/test/Transforms/SLPVectorizer/AMDGPU/fma-operand-contract-selection.ll
+27-3llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+63-92 files

LLVM/project 0d18bb6clang/docs ReleaseNotes.md, clang/lib/Parse ParseOpenMP.cpp

[Clang][OpenMP] Fixed an assertion when `#pragma omp declare simd` or `#pragma omp declare variant` is followed by another OpenMP declarative directive containing a qualified identifier (#217875)

For code
```cpp
void foo();

#pragma omp declare simd
#pragma omp declare target to(foo)
```
Clang currently accepts this without rejection. The underlying cause is
that OpenMP pragma parsing for directives like `declare target to(...)`
performs name lookup without advancing the source location to create a
new declaration. As a result, the parser fetches the existing Decl of
foo and passes it up to declare simd, silently bypassing Sema
diagnostics.

https://godbolt.org/z/szPne5n45

---

    [27 lines not shown]
DeltaFile
+11-0clang/lib/Parse/ParseOpenMP.cpp
+11-0clang/test/SemaOpenMP/gh217204.cpp
+1-0clang/docs/ReleaseNotes.md
+23-03 files

LLVM/project cba529dllvm/lib/Analysis LoopAccessAnalysis.cpp, llvm/test/Transforms/LoopVectorize dereferenceable-info-from-assumption-constant-size.ll

[LAA] ZExt size from deref bundles to widest type. (#217939)

The size in a dereferenceable bundle may have a different bitwidth than
the access size. Both are interpreted as unsigned values. Update
WidestTy to account for possibility of the type for the bundle being
narrower.

Fixes a crash similar to
https://github.com/llvm/llvm-project/pull/217770.

PR: https://github.com/llvm/llvm-project/pull/217939
DeltaFile
+106-0llvm/test/Transforms/LoopVectorize/dereferenceable-info-from-assumption-constant-size.ll
+1-0llvm/lib/Analysis/LoopAccessAnalysis.cpp
+107-02 files

LLVM/project 8f5ef73llvm/lib/Analysis ScalarEvolution.cpp, llvm/test/Analysis/ScalarEvolution exit-count-greater-than.ll

[SCEV] Avoid overflow in howManyGreaterThans. (#217744)

howManyGreaterThans computes the backedge-taken count as ((Start - End)
+ (Stride - 1)) /u Stride. The addition can overflow, causing incorrect
results.

Instead, use getUDivCeilSCEV if Start >= End, mirroring
howManyLessThans. It also has additional handling for stride being a
power of 2, which allows using the simpler formula in more cases.

I'll check if we can unify the code (as implied by the FIXME I think),
instead of duplicating more logic.

Fixes https://github.com/llvm/llvm-project/issues/217537.
Fixes https://github.com/llvm/llvm-project/issues/187472.

PR: https://github.com/llvm/llvm-project/pull/217744
DeltaFile
+21-27llvm/test/Analysis/ScalarEvolution/exit-count-greater-than.ll
+22-10llvm/lib/Analysis/ScalarEvolution.cpp
+43-372 files

LLVM/project c0feba8clang-tools-extra/clang-tidy/utils ExceptionAnalyzer.cpp, clang-tools-extra/test/clang-tidy/checkers/bugprone exception-escape-treat-functions-without-specification-as-throwing.cpp exception-escape-coro-unknown.cpp

[clang-tidy] Fix crashes when analyzing unknown exceptions in bugprone-exception-escape (#218067)

`ExceptionAnalyzer` represents exceptions of unknown type with a null
`Type`, but some consumers dereferenced it unconditionally, resulting in
a crash when `TreatFunctionsWithoutSpecificationAsThrowing` is enabled.
This commit fixes the problem by skipping type-dependent processing for
unknown exceptions.

Fixes #217649
DeltaFile
+42-0clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape-coro-unknown.cpp
+17-1clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape-treat-functions-without-specification-as-throwing.cpp
+4-0clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp
+63-13 files

LLVM/project dc14f0allvm/docs LangRef.md

[LangRef] Fix code examples for fptosi/fptoui (#218121)

These cases were introduced before the poison value:
https://github.com/llvm/llvm-project/commit/59b6b7d9e416b3560528686ed0afa3d38160b9c5.
DeltaFile
+4-4llvm/docs/LangRef.md
+4-41 files

LLVM/project 0773125libc/src/__support/FPUtil FPBits.h

nit
DeltaFile
+4-4libc/src/__support/FPUtil/FPBits.h
+4-41 files

LLVM/project 07ec1cblibc/src/__support/FPUtil float80.h, libc/test/src/__support/FPUtil float80_test.cpp

suggestions and add more operators
DeltaFile
+40-16libc/src/__support/FPUtil/float80.h
+34-5libc/test/src/__support/FPUtil/float80_test.cpp
+74-212 files

LLVM/project eea571blibc/src/__support/FPUtil float80.h, libc/test/src/__support/FPUtil float80_test.cpp

feat: add negation and a test for it
DeltaFile
+7-0libc/src/__support/FPUtil/float80.h
+2-0libc/test/src/__support/FPUtil/float80_test.cpp
+9-02 files

LLVM/project 9c43912libc/src/__support/FPUtil FPBits.h

formatting
DeltaFile
+4-4libc/src/__support/FPUtil/FPBits.h
+4-41 files

LLVM/project 04630balibc/test/src/__support/FPUtil float80_test.cpp

nit
DeltaFile
+0-3libc/test/src/__support/FPUtil/float80_test.cpp
+0-31 files

LLVM/project 185aa8clibc/src/__support/FPUtil dyadic_float.h

nit
DeltaFile
+2-1libc/src/__support/FPUtil/dyadic_float.h
+2-11 files

LLVM/project c15cc46libc/src/__support/FPUtil dyadic_float.h

test: limit EXTRA_FRAC_LEN to be non-negative

test

test

nit

revert

revert

only add >0 condition

format
DeltaFile
+0-4libc/src/__support/FPUtil/dyadic_float.h
+0-41 files

LLVM/project 3feba51libc/src/__support/FPUtil dyadic_float.h

nit
DeltaFile
+1-0libc/src/__support/FPUtil/dyadic_float.h
+1-01 files

LLVM/project 19c92b5libc/src/__support/FPUtil FPBits.h

Removed temporarliy for 128bit container only
DeltaFile
+4-4libc/src/__support/FPUtil/FPBits.h
+4-41 files

LLVM/project 01aa9e0libc/src/__support/FPUtil float80.h, libc/test/src/__support/FPUtil float80_test.cpp

add tests
DeltaFile
+21-0libc/src/__support/FPUtil/float80.h
+15-0libc/test/src/__support/FPUtil/float80_test.cpp
+36-02 files

LLVM/project 7e7f596libc/src/__support/FPUtil dyadic_float.h

add explicit bit handling for dyadic_float as per FPBits
DeltaFile
+2-0libc/src/__support/FPUtil/dyadic_float.h
+2-01 files

LLVM/project 80b6720libc/src/__support/FPUtil FPBits.h

test
DeltaFile
+4-4libc/src/__support/FPUtil/FPBits.h
+4-41 files