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

LLVM/project 860c2c9mlir/include/mlir/Dialect/List/IR ListOps.td, mlir/include/mlir/Dialect/List/Transforms Passes.td

more patterns
DeltaFile
+144-0mlir/lib/Dialect/List/Transforms/ListLowerMap.cpp
+123-0mlir/test/Dialect/List/lower-map.mlir
+100-0mlir/lib/Dialect/List/Transforms/ListLowerRange.cpp
+53-0mlir/include/mlir/Dialect/List/IR/ListOps.td
+52-0mlir/test/Dialect/List/lower-range.mlir
+34-0mlir/include/mlir/Dialect/List/Transforms/Passes.td
+506-03 files not shown
+528-09 files

LLVM/project 5104dadclang/lib/Analysis CFG.cpp, clang/test/Analysis cfg-compound-assignment-eval-order.cpp loopexit-cfg-output.cpp

[clang][CFG] Fix compound assignment evaluation order (#212115)

CompoundAssignOperator (e.g. `+=`, `-=`, `<<=`) is a distinct StmtClass
deriving from BinaryOperator, but it was not handled in the CFGBuilder
dispatch switches. As a result it fell through to the generic default
path (VisitChildren over reverse_children), which emits the LHS before
the RHS in the CFG.

Per C++17 [expr.ass]/1, all assignment operators - simple and compound -
sequence the right operand before the left operand. Route
CompoundAssignOperator through VisitBinaryOperator (and
VisitBinaryOperatorForTemporaries), whose existing isAssignmentOp()
branch already emits the RHS before the LHS, matching simple assignment.

This mirrors the class of evaluation-order defect fixed for lambda
captures in f3b31871e9b8.

rdar://183253943

Assisted-By: claude
DeltaFile
+66-0clang/test/Analysis/cfg-compound-assignment-eval-order.cpp
+3-3clang/test/Analysis/loopexit-cfg-output.cpp
+2-2clang/test/Sema/warn-unreachable.c
+2-0clang/lib/Analysis/CFG.cpp
+73-54 files

LLVM/project 150f33clibcxx/include/__algorithm pstl.h, libcxx/include/__pstl/backends default.h

[libc++][pstl] Implementation of a parallel std::mismatch() based on __pstl::__parallel_find() (#209291)

This PR adds a parallel version of `std::mismatch` as one of the backend
operations.
It also provides an implementation based on `__pstl::__parallel_find()`
which does the heavy lifting.
`libdispatch` and `std_thread` backends expose this implementation under
their backend tags, while the `serial` backend redirects the calls to
the serial `std::mismatch`.

4 flavours of the function are exposed: 3-legged, 3-legged with
predicate, 4-legged, 4-legged with predicate.
3-legged flavours are implemented in the `default` (`composition`)
backend by redirecting the call to the 4-legged flavours.

Included tests check that:

- Semantics of the iterator-only functions is correct.
- Semantics of the predicated functions is correct.

    [7 lines not shown]
DeltaFile
+267-0libcxx/test/std/algorithms/alg.nonmodifying/mismatch/pstl.mismatch_pred.pass.cpp
+226-0libcxx/test/std/algorithms/alg.nonmodifying/mismatch/pstl.mismatch.pass.cpp
+90-0libcxx/include/__pstl/cpu_algos/mismatch.h
+90-0libcxx/include/__algorithm/pstl.h
+37-0libcxx/include/__pstl/backends/default.h
+25-0libcxx/test/std/algorithms/pstl.exception_handling.pass.cpp
+735-08 files not shown
+809-114 files

LLVM/project a81db64libc/src/__support/CPP string.h CMakeLists.txt, libc/test/UnitTest LibcTest.cpp

[libc][cpp::string] Allocate fewer temp strings in operator= and += (#210895)

This PR generally updates `cpp::string` to avoid incidental allocations.
Specifically, it:

- Updates `opreator=(string_view)` to avoid allocating a temporary
string:
https://github.com/llvm/llvm-project/blob/67ebc4b221c3e94028b33004cd5cd08deee95048/libc/src/__support/CPP/string.h#L106-L108
- Changes `operator+=(const string&)` to accept a `string_view` so that
strings may be appended without allocation.
- Makes the `string(string_view)` constructor explicit. Before, there
were non-obvious allocations because of the implicit conversion.

As a side effect, this PR has to more carefully handle self-assignment
and self-append. This PR updates append and assignment to avoid calling
`realloc` during append / assignment, as this may invalidate input
pointers held by `string_view` if they point to data held by the string.
This also fixes self-assignment, which previously didn't work, eg
`cpp::string s = "abc"; s = s;` would zero out `s`.
DeltaFile
+89-39libc/src/__support/CPP/string.h
+62-0libc/test/src/__support/CPP/string_test.cpp
+4-1libc/test/src/stdlib/realpath_test.cpp
+1-1libc/test/UnitTest/LibcTest.cpp
+1-0libc/src/__support/CPP/CMakeLists.txt
+157-415 files

LLVM/project 9d60191libcxxabi/test test_aux_runtime_op_array_new.pass.cpp cxa_vec_new_overflow_PR41395.pass.cpp

[libc++abi][NFC] Remove some XFAILs which never trigger (#211241)

The oldest library we support is from LLVM 12, so we can remove any
XFAILs for libraries built before that.
DeltaFile
+0-4libcxxabi/test/test_aux_runtime_op_array_new.pass.cpp
+0-3libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp
+0-3libcxxabi/test/dynamic_cast.pass.cpp
+0-3libcxxabi/test/uncaught_exceptions.pass.cpp
+0-134 files

LLVM/project c94c90bclang/include/clang/StaticAnalyzer/Core/PathSensitive SMTConv.h, clang/test/Analysis/z3 z3-atomic.c

[analyzer] Fix _Atomic crashes for Z3 symbolic execution (#212050)

This PR fixes _Atomic crashes for Z3 symbolic execution by passing the
types through getAtomicUnqualifiedType and getCanonicalType and skip
casting in fromCast if `FromTy == ToTy && FromBitWidth == ToBitWidth`.

Assisted-by: Codex
DeltaFile
+18-7clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConv.h
+20-0clang/test/Analysis/z3/z3-atomic.c
+38-72 files

LLVM/project 28c8e89clang-tools-extra/include-cleaner/unittests TypesTest.cpp, llvm/include/llvm/ADT IntrusiveRefCntPtr.h

[llvm][ADT] Mark llvm::IntrusiveRefCntPtr with the warn_unused attribute (#211795)

IntrusiveRefCntPtr has non-trivial ctor/dtor, thus unused variables
wouldn't trigger a warning by default. However, they should.
https://clang.llvm.org/docs/AttributeReference.html#warn-unused

Let's mark the class with this attribute get warned about them.

This would have helped catching #211518 and #211517.
Supersedes #211647.

Some tests had to be uplifted because some bots used `-Werror` for those tests.
DeltaFile
+0-6clang-tools-extra/include-cleaner/unittests/TypesTest.cpp
+6-0llvm/include/llvm/Support/Compiler.h
+4-0llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp
+2-1llvm/include/llvm/ADT/IntrusiveRefCntPtr.h
+1-1llvm/unittests/Support/VirtualOutputBackendTest.cpp
+13-85 files

LLVM/project abc28fclibc/test/src/__support/CPP string_test.cpp

Reflect updated capacity() api in tests
DeltaFile
+10-4libc/test/src/__support/CPP/string_test.cpp
+10-41 files

LLVM/project 3678fa2llvm/lib/Transforms/Utils SimplifyCFG.cpp

[SimplifyCFG] Don't create new unreachable BB in `turnSwitchRangeIntoICmp` (#212035)

Previously we relied on `createUnreachableSwitchDefault` to remove
incoming edges in phi nodes and update DT. However, it also creates a
new unreachable BB and updates the default destination of the switch
instruction, which is about to be replaced by a branch instruction. This
patch inlines the function and removes logic about the new BB, to make
sure the DT is updated correctly.

This issue cannot be reproduced via
-simplifycfg-require-and-preserve-domtree=1. I just found it by checking
DT in requestResimplify (will be added after fixing all existing
issues). The following test covers this case:

https://github.com/llvm/llvm-project/blob/5bc304c65494702d9d4928ff6cb369e6e6496e53/llvm/test/Transforms/SimplifyCFG/switch-range-to-icmp.ll#L38-L73
DeltaFile
+11-6llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+11-61 files

LLVM/project 0acd2c5clang-tools-extra/clang-tidy rename_check.py

[clang-tidy] Support Markdown documentation in rename_check.py (#210577)

Part of https://github.com/llvm/llvm-project/issues/201242
DeltaFile
+8-9clang-tools-extra/clang-tidy/rename_check.py
+8-91 files

LLVM/project c4b8985clang-tools-extra/clang-tidy/misc RedundantExpressionCheck.cpp, clang-tools-extra/docs ReleaseNotes.rst

[clang-tidy] Fix nested macro false positives in misc-redundant-expression (#209385)

Apply the existing macro-origin filtering when comparing flattened
operands in nested expressions.

Closes https://github.com/llvm/llvm-project/issues/209373
DeltaFile
+81-76clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp
+14-0clang-tools-extra/test/clang-tidy/checkers/misc/redundant-expression.cpp
+5-0clang-tools-extra/docs/ReleaseNotes.rst
+100-763 files

LLVM/project dded96bmlir/include/mlir/Dialect/List/IR ListOps.td, mlir/lib/Dialect/List/IR ListOps.cpp

list dialect
DeltaFile
+271-0mlir/include/mlir/Dialect/List/IR/ListOps.td
+139-0mlir/lib/Dialect/List/IR/ListOps.cpp
+136-0mlir/test/Dialect/List/simplify.mlir
+129-0mlir/lib/Dialect/List/Transforms/ListSimplify.cpp
+128-0mlir/test/Dialect/List/ops.mlir
+122-0mlir/lib/Dialect/List/Transforms/ListSimplifyElements.cpp
+925-019 files not shown
+1,418-025 files