LLVM/project 677f13emlir/lib/Dialect/Arith/IR ArithOps.cpp ArithCanonicalization.td, mlir/test/Dialect/Arith canonicalize.mlir

[mlir][arith] Fix folds crashing on dynamic-shaped tensors (#212072)

`Builder::getZeroAttr` asserts when asked to build a constant of a
ranked tensor with a dynamic shape (`DenseElementsAttr` requires a
static shape). Three self-identity folds/patterns reached it without a
guard and aborted on dynamic-shaped operands:

```mlir
arith.xori %x, %x : tensor<?xi32>
arith.subui_extended %x, %x : tensor<?xi32>, tensor<?xi1>
arith.subi (arith.subi %a, %b), %a : tensor<?xi32>   (SubISubILHSRHSLHS)
```

Guard each with a static-shape check (as `arith.subi(x,x)` already does)
so they leave the op unfolded instead of crashing. The TableGen pattern
gets a new `IsScalarOrHasStaticShape` constraint.

Signed-off-by: Víctor Pérez Carrasco <victor.pc.upm at gmail.com>
DeltaFile
+34-0mlir/test/Dialect/Arith/canonicalize.mlir
+12-2mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+11-1mlir/lib/Dialect/Arith/IR/ArithCanonicalization.td
+57-33 files

LLVM/project 6a2bdfelld/ELF Driver.cpp, lld/ELF/Arch SPARCV9.cpp

[ELF,SPARC] Support ABS and RELATIVE dynamic relocations (#212155)

... and test some previously uncovered GOT relocation types.
Test convention follows ppc32-*, which I added in 2019.

The SPARC psABI only defines Elf64_Rela. Add EM_SPARCV9 to getIsRela so
that dynamic relocations use .rela.dyn/.rela.plt instead of the
unsupported SHT_REL form.

Co-authored-by: Kirill A. Korinsky <kirill at korins.ky>

Co-authored-by: Kirill A. Korinsky <kirill at korins.ky>
DeltaFile
+39-0lld/test/ELF/sparcv9-reloc-got.s
+28-0lld/test/ELF/sparcv9-abs-pic.s
+19-0lld/ELF/Arch/SPARCV9.cpp
+4-3lld/ELF/Driver.cpp
+90-34 files

LLVM/project 99a8141libc/test/integration/src/pthread pthread_barrier_test.cpp, libc/test/src/signal sigaltstack_test.cpp

[libc][test][NFC] Fix compiler warnings in libc tests (#212100)

Resolved compiler warnings in several libc unit and integration tests:

- Fixed -Wmissing-designated-field-initializers in localtime_r_test.cpp
by using zero-initialisation instead of partial designated initialisers.
- Fixed -Wimplicit-int-conversion in sigaltstack_test.cpp by explicitly
casting the loop index to uint8_t.
- Fixed -Wunused-parameter in pthread_barrier_test.cpp by omitting
unused parameter names in function definitions.

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+3-27libc/test/src/time/localtime_r_test.cpp
+2-2libc/test/integration/src/pthread/pthread_barrier_test.cpp
+1-1libc/test/src/signal/sigaltstack_test.cpp
+6-303 files

LLVM/project 03bfccbclang/test/OffloadTools/clang-linker-wrapper linker-wrapper.c linker-wrapper-hip-no-rdc.c, clang/test/OffloadTools/clang-offload-bundler basic.c zlib.c

clang/AMDGPU: Migrate clang-linker-wrapper tests to amdgpu triples (15)

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+59-59clang/test/OffloadTools/clang-offload-bundler/basic.c
+33-33clang/test/OffloadTools/clang-linker-wrapper/linker-wrapper.c
+16-16clang/test/OffloadTools/clang-linker-wrapper/linker-wrapper-hip-no-rdc.c
+16-16clang/test/OffloadTools/clang-offload-bundler/zlib.c
+10-10clang/test/OffloadTools/clang-offload-bundler/zstd.c
+8-8clang/test/OffloadTools/clang-offload-bundler/asserts-on.c
+142-1424 files not shown
+149-14910 files

LLVM/project 4068f4dlld/ELF OutputSections.cpp InputSection.cpp, lld/test/ELF eh-frame-dynrel-offset.s

[ELF] Fix dynamic relocations in .eh_frame (#210967)

scanEhSection translates input offsets to merged .eh_frame offsets
before creating dynamic relocations. DynamicReloc::getOffset translated
them a second time through EhInputSection.

Use the synthetic parent for already merged offsets, and use the
finalized relocation offset when verifying applied addends.

---------

Co-authored-by: Fangrui Song <i at maskray.me>
DeltaFile
+68-0lld/test/ELF/eh-frame-dynrel-offset.s
+3-3lld/ELF/OutputSections.cpp
+6-0lld/ELF/InputSection.cpp
+5-0lld/ELF/InputSection.h
+1-2lld/ELF/Relocations.cpp
+1-1lld/ELF/SyntheticSections.cpp
+84-61 files not shown
+85-77 files

LLVM/project e92d89allvm/test/CodeGen/AMDGPU vsrc-simplify-asynccnt.mir

Rebase

Change-Id: Ia0e7df7e06f00f1f329d3fdc2809a2e737ed494a
DeltaFile
+4-4llvm/test/CodeGen/AMDGPU/vsrc-simplify-asynccnt.mir
+4-41 files

LLVM/project 814a883llvm/include/llvm/Analysis ScalarEvolutionExpressions.h ScalarEvolutionPatternMatch.h, llvm/lib/Analysis ScalarEvolution.cpp

[SCEV] Remove ptrtoint expression (NFC). (#212038)

Follow-up to https://github.com/llvm/llvm-project/pull/180244 to remove
the now unused SCEVPtrToIntExpr.

PR: https://github.com/llvm/llvm-project/pull/212038
DeltaFile
+3-44llvm/lib/Analysis/ScalarEvolution.cpp
+2-30llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
+0-11llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
+0-6llvm/include/llvm/Analysis/ScalarEvolutionPatternMatch.h
+0-4llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+0-4polly/lib/Support/SCEVValidator.cpp
+5-997 files not shown
+6-11313 files

LLVM/project cb64bb4llvm/lib/Target/AMDGPU SIInsertWaitcnts.cpp

Do not allow vm_vsrc simplifications if outstanding asyncmarks

Change-Id: Ib55e86ba1c13fc54a64bc8b424dfc50d9c899062
DeltaFile
+1-1llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+1-11 files

LLVM/project 7dfe1d7llvm/lib/Target/AMDGPU SIInsertWaitcnts.cpp, llvm/test/CodeGen/AMDGPU vsrc-simplify-asynccnt.mir

track asyncmarks for vm_vsrc simplifications

Change-Id: I2d274814df14d5844e05e801facea39d0aa14b4b
DeltaFile
+91-0llvm/test/CodeGen/AMDGPU/vsrc-simplify-asynccnt.mir
+2-0llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+93-02 files

LLVM/project abdf411llvm/lib/Target/AMDGPU SIInsertWaitcnts.cpp, llvm/test/CodeGen/AMDGPU vsrc-simplify-asynccnt.mir

[AMDGPU] Track async events for vm_vrsc simplifications

Change-Id: Ib8f6c7f73b440b90c80da191ba52980c1f216122
DeltaFile
+2-2llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+1-0llvm/test/CodeGen/AMDGPU/vsrc-simplify-asynccnt.mir
+3-22 files

LLVM/project c4188f9llvm/test/CodeGen/AMDGPU vsrc-simplify-asynccnt.mir

Precommit test to show impact

Change-Id: Ia835c90c2087d3e7453917a1f62c0d2d7f27d531
DeltaFile
+30-0llvm/test/CodeGen/AMDGPU/vsrc-simplify-asynccnt.mir
+30-01 files

LLVM/project 39eb2a1clang/test/CIR/CodeGen coro-task.cpp coro-exceptions.cpp, clang/test/CIR/CodeGenCoroutines coro-task.cpp coro-exceptions.cpp

[CIR][NFC] Reorganize coroutine tests (#211152)

Move the coroutine tests into a dedicated CodeGenCoroutines directory.
This is a test only reorganization in preparation for upcoming
coroutine-related changes.
DeltaFile
+0-900clang/test/CIR/CodeGen/coro-task.cpp
+784-0clang/test/CIR/CodeGenCoroutines/coro-task.cpp
+152-0clang/test/CIR/CodeGenCoroutines/Inputs/coroutine.h
+0-138clang/test/CIR/CodeGen/coro-exceptions.cpp
+93-0clang/test/CIR/CodeGenCoroutines/coro-exceptions.cpp
+1,029-1,0385 files

LLVM/project 86b9476clang/docs ReleaseNotes.md, clang/lib/StaticAnalyzer/Checkers CStringChecker.cpp

Revert "[analyzer] Model strchr/strrchr/memchr/strstr/strpbrk/strchrnul (#207267)"

This reverts commit a34cb573eae65f48f0e51147289e042a86b55d16.

This feature caused some issues (#209905), so the best course of
action is to postpone it to clang-24 and revert from this branch.
The #210154 tried to fix the surfaced issue, and considered to nominate
it for backport in #211832, but ultimately we had to revert it from
main in #211857 - this confirms that probably the best action is to
revert the half-baked feature from the release branch.

This means that #203260 won't be fixed in clang-23, and that's fine.
DeltaFile
+0-178clang/test/Analysis/string-search-modeling.c
+4-79clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
+0-1clang/docs/ReleaseNotes.md
+4-2583 files

LLVM/project e0743f5.github/workflows libclang-abi-tests.yml

workflows/libclang-abi-tests: Fix missing environment variable (#211959)

This was accidentally removed in
f6af6cedfd2fa731bf323608116d373379838b9a.

(cherry picked from commit 2ad69983d8b72d8a665a2552aac15517fe0cb351)
DeltaFile
+1-0.github/workflows/libclang-abi-tests.yml
+1-01 files

LLVM/project 772bb63.github/workflows release-tasks.yml

workflows/relase-tasks: Fix variable name typo (#211732)

(cherry picked from commit bab258ae1eaa56cbdc86b19f8063be612e1e4795)
DeltaFile
+1-1.github/workflows/release-tasks.yml
+1-11 files

LLVM/project c7c350e.github/workflows release-documentation.yml

workflows/release-documentation: Fix variable name typo (#211729)

(cherry picked from commit ae0f00de4ce82fb933c326980464c8cefb4e0029)
DeltaFile
+1-1.github/workflows/release-documentation.yml
+1-11 files

LLVM/project 7bbaa66llvm/lib/Transforms/Vectorize LoopVectorize.cpp VPlanHelpers.h

Reapply "[VPlan] Re-use VPSlotTracker when printing recipes for costs (NFC)." (#209003) (#211763)

This reverts commit 4c7948d06c93e8d233cd4733fd4107f3b68bc7bc. The commit
always constructs slot on first use, to fix compile-time regressions in
release builds.

Original message:
VPRecipeBase::dump() constructs a fresh VPSlotTracker instance on each
call. VPSlotTracker construction requires iterating over all recipes in
the plan, to number all VPValues.

To avoid doing lots of unnecessary work when printing VPlan costs,
construct a shared VPSlotTracker in VPCostContext, re-used by all
prints.

This can speed up debug output for large loops.

PR: https://github.com/llvm/llvm-project/pull/203386
DeltaFile
+14-5llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+18-1llvm/lib/Transforms/Vectorize/VPlanHelpers.h
+10-0llvm/lib/Transforms/Vectorize/VPlan.cpp
+6-1llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+48-74 files

LLVM/project f3f2cd6llvm/utils/gn/secondary/libcxx/include BUILD.gn

[gn build] Port a434fe87cce7 (#212137)
DeltaFile
+4-0llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+4-01 files

LLVM/project 1f48ea0libcxx/include CMakeLists.txt

[libc++] Removing traiilng whitespace at line end in CMakeLists.txt (#212135)

Follow-up to #209291.
DeltaFile
+1-1libcxx/include/CMakeLists.txt
+1-11 files

LLVM/project 1d349c7llvm/utils/gn/secondary/libcxx/include BUILD.gn

[gn build] Port 150f33ce2895 (#212136)
DeltaFile
+1-0llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+1-01 files

LLVM/project 07b5c31llvm/test/Transforms/ConstraintElimination partial-decomposition.ll constraint-overflow.ll

[ConstraintElim] Re-organize tests with decomposition failures (NFC). (#212130)

Add more tests for failed decomposition, consolidate them in
partial-decomposition.ll.
DeltaFile
+305-0llvm/test/Transforms/ConstraintElimination/partial-decomposition.ll
+63-0llvm/test/Transforms/ConstraintElimination/constraint-overflow.ll
+0-46llvm/test/Transforms/ConstraintElimination/retry-without-decomposition.ll
+2-2llvm/test/Transforms/ConstraintElimination/induction-condition-in-loop-exit-postinc.ll
+370-484 files

LLVM/project 06fb520llvm/utils/gn README.rst, llvm/utils/gn/build BUILDCONFIG.gn

Revert "gn build: Support building debug binaries from a release build directory." (#211294)

This reverts commit 611d015f0030e0d4f1b3bd2270205f6f6b6e20eb.

Breaks building, see
https://github.com/llvm/llvm-project/pull/197843#issuecomment-5025645797
DeltaFile
+392-398llvm/utils/gn/secondary/clang/lib/Headers/BUILD.gn
+38-46llvm/utils/gn/secondary/BUILD.gn
+28-37llvm/utils/gn/secondary/clang-tools-extra/clang-doc/tool/BUILD.gn
+14-41llvm/utils/gn/build/toolchain/BUILD.gn
+13-23llvm/utils/gn/build/BUILDCONFIG.gn
+5-16llvm/utils/gn/README.rst
+490-56124 files not shown
+518-60230 files

LLVM/project 14304efllvm/bindings/ocaml/llvm llvm.mli, llvm/include/llvm/IR Instructions.h InstVisitor.h

[IR] Remove deprecated BranchInst (#212095)

The migration to UncondBr/CondBr was finished in LLVM 23. BranchInst has
no remaining uses in-tree. Let's finish this by removing BranchInst.

https://discourse.llvm.org/t/rfc-split-branchinst-into-uncondbr-and-condbr/90022

Deprecated with: https://github.com/llvm/llvm-project/pull/187314
DeltaFile
+2-113llvm/include/llvm/IR/Instructions.h
+8-14llvm/lib/IR/Instructions.cpp
+3-10llvm/include/llvm/IR/InstVisitor.h
+0-12llvm/unittests/IR/InstructionsTest.cpp
+3-4llvm/bindings/ocaml/llvm/llvm.mli
+16-1535 files

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

Update
DeltaFile
+21-90llvm/test/Analysis/DependenceAnalysis/banerjee-symbolic.ll
+43-62llvm/lib/Analysis/DependenceAnalysis.cpp
+1-57llvm/test/Analysis/DependenceAnalysis/banerjee-overflow.ll
+48-0llvm/test/Analysis/DependenceAnalysis/banerjee-single-iteration.ll
+7-6llvm/include/llvm/Analysis/DependenceAnalysis.h
+120-2155 files

LLVM/project bdd8c64mlir/lib/Dialect/Arith/IR ArithOps.cpp, mlir/test/Conversion/ArithToLLVM arith-to-llvm.mlir

[mlir][arith] Fold trivial integer division and remainder (#212074)

Add value-preserving folds mirroring LLVM's InstructionSimplify for the
integer division and remainder ops:

```
divui/divsi/ceildivui/ceildivsi/floordivsi(0, x) -> 0
divui/divsi/ceildivui/ceildivsi/floordivsi(x, x) -> 1
remui/remsi(0, x) -> 0
remui/remsi(x, x) -> 0
```

The self and zero-dividend cases are valid refinements because division
or remainder by zero is undefined behaviour; no overflow flags are
required. The folds return a scalar or splat constant and bail out on
shaped types with a dynamic shape.

Folding `x / 0` and `x % 0` to poison is left as a TODO: it would make
the arith dialect depend on the ub dialect to materialize `ub.poison`.

    [20 lines not shown]
DeltaFile
+119-0mlir/test/Dialect/Arith/canonicalize.mlir
+93-2mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+12-12mlir/test/Conversion/ArithToLLVM/arith-to-llvm.mlir
+11-11mlir/test/Conversion/ArithToSPIRV/arith-to-spirv.mlir
+2-2mlir/test/Conversion/ArithToSPIRV/arith-to-spirv-unsupported.mlir
+237-275 files

LLVM/project 286fccelibcxx/include/__chrono hh_mm_ss.h, libcxx/test/std/time/time.hms/time.hms.members hours.pass.cpp is_negative.pass.cpp

[libc++][chrono] Implement LWG 4274: Allow chrono::hh_mm_ss to be constructed from unsigned durations (#209686)

**_Implementation details_**:
- Use `is_unsigned_v` instead of `numeric_limits<Rep>::is_signed`, which
is used by `chrono::abs`. `numeric_limits<Rep>::is_signed` may return
false when a custom `Rep` does not specialize `numeric_limits`. Relying
on it to detect the unsigned case could therefore be unreliable for such
a type. `is_unsigned_v` instead gives a compile-time path for built-in
unsigned types, while the sign check keeps signed types correct.

- The constructor calls `__abs_d` four times because each member is
initialized separately. This should not affect runtime performance
because the compiler should inline `__abs_d` and eliminate the repeated
calculations. We could use another helper function or helper class to
explicitly compute the absolute duration only once. However, this would
add extra glue code, and the added complexity is not worthwhile I think.

---------

Co-authored-by: A. Jiang <de34 at live.cn>
DeltaFile
+13-6libcxx/include/__chrono/hh_mm_ss.h
+2-0libcxx/test/std/time/time.hms/time.hms.members/hours.pass.cpp
+2-0libcxx/test/std/time/time.hms/time.hms.members/is_negative.pass.cpp
+2-0libcxx/test/std/time/time.hms/time.hms.members/minutes.pass.cpp
+2-0libcxx/test/std/time/time.hms/time.hms.members/seconds.pass.cpp
+2-0libcxx/test/std/time/time.hms/time.hms.members/subseconds.pass.cpp
+23-62 files not shown
+26-78 files

LLVM/project f44f9e5llvm/lib/TargetParser RISCVISAInfo.cpp, llvm/unittests/Target/RISCV RISCVBaseInfoTest.cpp CMakeLists.txt

[𝘀𝗽𝗿] initial version

Created using spr 1.3.8-beta.1-arichardson
DeltaFile
+50-0llvm/unittests/Target/RISCV/RISCVBaseInfoTest.cpp
+21-0llvm/unittests/TargetParser/RISCVISAInfoTest.cpp
+2-0llvm/lib/TargetParser/RISCVISAInfo.cpp
+1-0llvm/unittests/Target/RISCV/CMakeLists.txt
+74-04 files

LLVM/project 9dab351flang/lib/Lower/OpenMP OpenMP.cpp

format
DeltaFile
+1-1flang/lib/Lower/OpenMP/OpenMP.cpp
+1-11 files

LLVM/project 61517a8libcxx/include fstream

[libc++][NFC] Inline fstream functions into the class body (#211738)

The `fstream` member functions are all really short, so inlining them
removes quite a bit of boiler plate code.
DeltaFile
+60-102libcxx/include/fstream
+60-1021 files

LLVM/project 1196889flang/include/flang/Parser parse-tree.h, flang/lib/Lower/OpenMP Clauses.cpp OpenMP.cpp

[flang][OpenMP] Split DEFAULT into DEFAULT(dsa) and DEFAULT(variant)

The 5.0 and 5.1 specs used DEFAULT clause for what is now OTHERWISE.
Separate these two claues to be able to specify their properties
independently.
DeltaFile
+14-16flang/lib/Semantics/resolve-directives.cpp
+7-17flang/lib/Lower/OpenMP/Clauses.cpp
+11-9flang/include/flang/Parser/parse-tree.h
+10-6flang/lib/Parser/openmp-parsers.cpp
+4-6flang/lib/Lower/OpenMP/OpenMP.cpp
+7-1llvm/include/llvm/Frontend/OpenMP/OMP.td
+53-555 files not shown
+63-5911 files