Changes

Summary

  1. Use reference type in for loop (details)
  2. [Verifier] Add context for assume operand bundles verifier errors (details)
  3. [debugserver] Fix BUILDING_FOR_ARM64_OSX (details)
  4. Remove unneeded variable num_found. (details)
  5. [libc++] [test] Add tests for converting array types in shared_ptr. (details)
  6. [x86] add tests for psubus; NFC (details)
  7. [AMDGPU] add test for usubsat; NFC (details)
  8. Fix clang-tidy warnings in MLIR Python bindings (NFC) (details)
  9. [runtimes] Trigger CI on changes to libunwind (details)
  10. [libc++][NFC] Mark LWG3573 as complete (details)
  11. [libc++] Make __weekday_from_days private in weekday (details)
  12. [LoopPredication] Calculate profitability without BPI (details)
  13. [RISCV] Use llvm::stable_sort instead of std::stable_sort. NFC (details)
  14. [indvars] Canonicalize exit conditions to unsigned using range info (details)
  15. Extend transform introduced in D111896 to multiple exits (details)
  16. [SCEV] Avoid compile time explosion in ScalarEvolution::isImpliedCond (details)
  17. Revert "Reland [clang] Pass -clear-ast-before-backend in Clang::ConstructJob()" (details)
  18. [SCEV] Fix formatting error introduced by D112080 (details)
Commit 7812cb72a321c392a3b91b45b4780a0987818a36 by carlosgalvezp
Use reference type in for loop

To fix failing build job.
The file was modifiedclang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
Commit ac0561ebb734e6241d76c4661507960e8a6dfb20 by aeubanks
[Verifier] Add context for assume operand bundles verifier errors

And fix a typo.
The file was modifiedllvm/lib/IR/Verifier.cpp
The file was modifiedllvm/test/Verifier/assume-bundles.ll
Commit 1529738b6619cdf817feb31771b57a893accf63b by Jonas Devlieghere
[debugserver] Fix BUILDING_FOR_ARM64_OSX

Check for TARGET_CPU_ARM64 (ARM instructions for 64-bit mode) rather
than TARGET_CPU_ARM (instructions for 32-bit mode).
The file was modifiedlldb/tools/debugserver/source/CMakeLists.txt
Commit a66798cd67fedc35efbb8986deef417631bbc88a by jingham
Remove unneeded variable num_found.
The file was modifiedlldb/source/Interpreter/CommandInterpreter.cpp
Commit b84da5ba6e31e9e264370ac2b47536a7b50ef4fd by Louis Dionne
[libc++] [test] Add tests for converting array types in shared_ptr.

The only possible kind of a conversion in initialization of a shared
pointer to an array is a qualification conversion (i.e., adding
cv-qualifiers). This patch adds tests for converting from `A[]` to
`const A[]` to the following functions:

```
template<class Y> explicit shared_ptr(Y* p);

template<class Y> shared_ptr(const shared_ptr<Y>& r);
template<class Y> shared_ptr(shared_ptr<Y>&& r);

template<class Y> shared_ptr& operator=(const shared_ptr<Y>& r);
template<class Y> shared_ptr& operator=(shared_ptr<Y>&& r);

template<class Y> void reset(Y* p);
template<class Y, class D> void reset(Y* p, D d);
template<class Y, class D, class A> void reset(Y* p, D d, A a);
```

Similar tests for converting functions that involve a `weak_ptr` should
be added once LWG issue [3001](https://cplusplus.github.io/LWG/issue3001)
is implemented.

Differential Revision: https://reviews.llvm.org/D112048
The file was modifiedlibcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y.pass.cpp
The file was modifiedlibcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y.pass.cpp
The file was modifiedlibcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp
The file was modifiedlibcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp
The file was modifiedlibcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer.pass.cpp
The file was modifiedlibcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter.pass.cpp
The file was modifiedlibcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter_allocator.pass.cpp
The file was modifiedlibcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer.pass.cpp
Commit 081bad1d4d4eacc2e638eb28ff7e0c8193ef2618 by spatel
[x86] add tests for psubus; NFC
The file was modifiedllvm/test/CodeGen/X86/psubus.ll
Commit c1ca9e3077cb8ac39a56ebe73dd2b080fbe56c4e by spatel
[AMDGPU] add test for usubsat; NFC
The file was modifiedllvm/test/CodeGen/AMDGPU/usubsat.ll
Commit e2f16be5991af84e508fcd197bb5deb841aa0dc2 by joker.eph
Fix clang-tidy warnings in MLIR Python bindings (NFC)
The file was modifiedmlir/lib/Bindings/Python/IRAffine.cpp
The file was modifiedmlir/lib/Bindings/Python/IRCore.cpp
Commit a039746e1c0b0eef878dfa1e6d611e79bec193c1 by Louis Dionne
[runtimes] Trigger CI on changes to libunwind
The file was modifiedlibcxx/utils/ci/buildkite-pipeline-premerge.sh
Commit 494dad6b72d499ea832ab4b9b9bb76e0330e4eeb by joeloser93
[libc++][NFC] Mark LWG3573 as complete

Mark LWG3573 as complete. It involves a change in wording around when
`basic_string_view`'s constructor for iterator/sentinel can throw. The
current implementation is not marked conditionally `noexcept`, so there
is nothing to do here. Add a test that binds this behavior to verify the
constructor is not marked `noexcept(true)` when `end - begin` throws.

Reviewed By: ldionne, Mordante, #libc

Differential Revision: https://reviews.llvm.org/D111925
The file was modifiedlibcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp
The file was modifiedlibcxx/docs/Status/Cxx2bIssues.csv
Commit 622c40722e140239d14a19d1c3b7013de2863fe1 by joeloser93
[libc++] Make __weekday_from_days private in weekday

`weekday` has a static member function `__weekday_from_days` which is
not part of the mandated public interface of `weeekday` according to the
standard. Since it is only used internally in the constructors of
`weekday`, let's make it private.

Reviewed By: ldionne, Mordante, #libc

Differential Revision: https://reviews.llvm.org/D112072
The file was modifiedlibcxx/include/chrono
Commit 9403514e764950a0dfcd627fc90c73432314bced by anna
[LoopPredication] Calculate profitability without BPI

Using BPI within loop predication is non-trivial because BPI is only
preserved lossily in loop pass manager (one fix exposed by lossy
preservation is up for review at D111448). However, since loop
predication is only used in downstream pipelines, it is hard to keep BPI
from breaking for incomplete state with upstream changes in BPI.
Also, correctly preserving BPI for all loop passes is a non-trivial
undertaking (D110438 does this lossily), while the benefit of using it
in loop predication isn't clear.

In this patch, we rely on profile metadata to get almost similar benefit as
BPI, without actually using the complete heuristics provided by BPI.
This avoids the compile time explosion we tried to fix with D110438 and
also avoids fragile bugs because BPI can be lossy in loop passes
(D111448).

Reviewed-By: asbirlea, apilipenko
Differential Revision: https://reviews.llvm.org/D111668
The file was modifiedllvm/test/Transforms/LoopPredication/profitability.ll
The file was modifiedllvm/lib/Transforms/Scalar/LoopPredication.cpp
Commit dc8a5f9419f5cc35fc3c9e8698ba3ebb6a3f974f by craig.topper
[RISCV] Use llvm::stable_sort instead of std::stable_sort. NFC
The file was modifiedclang/utils/TableGen/RISCVVEmitter.cpp
Commit fca0218875f5117110d38b9cd7503bc2789693d3 by listmail
[indvars] Canonicalize exit conditions to unsigned using range info

This patch duplicates a bit of logic we apply to comparisons encountered during the IV users walk to conditions which feed exit conditions. Why? simplifyAndExtend has a very limited list of users it walks. In particular, in the examples is stops at the zext and never visits the icmp. (Because we can't fold the zext to an addrec yet in SCEV.) Being willing to visit when we haven't simplified regresses multiple tests (seemingly because of less optimal results when computing trip counts).

Note that this can be trivially extended to multiple exiting blocks. I'm leaving that to a future patch (solely to cut down on the number of versions of the same code in review at once.)

Differential Revision: https://reviews.llvm.org/D111896
The file was modifiedllvm/test/Transforms/IndVarSimplify/finite-exit-comparisons.ll
The file was modifiedllvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Commit 0836a1059dcf8e4fbf408248bf5eed13dfd93f7b by listmail
Extend transform introduced in D111896 to multiple exits

This is trivial.  It was left out of the original review only because we had multiple copies of the same code in review at the same time, and keeping them in sync was easiest if the structure was kept in sync.
The file was modifiedllvm/test/Transforms/IndVarSimplify/finite-exit-comparisons.ll
The file was modifiedllvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Commit 08619006a0c0694477f143dc1552eab35701e50b by bjorn.a.pettersson
[SCEV] Avoid compile time explosion in ScalarEvolution::isImpliedCond

As seen in PR51869 the ScalarEvolution::isImpliedCond function might
end up spending lots of time when doing the isKnownPredicate checks.

Calling isKnownPredicate for example result in isKnownViaInduction
being called, which might result in isLoopBackedgeGuardedByCond being
called, and then we might get one or more new calls to isImpliedCond.
Even if the scenario described here isn't an infinite loop, using
some random generated C programs as input indicates that those
isKnownPredicate checks quite often returns true. On the other hand,
the third condition that needs to be fulfilled in order to "prove
implications via truncation", i.e. the isImpliedCondBalancedTypes
check, is rarely fulfilled.
I also made some similar experiments to look at how often we would
get the same result when using isKnownViaNonRecursiveReasoning instead
of isKnownPredicate. So far I haven't seen a single case when codegen
is negatively impacted by using isKnownViaNonRecursiveReasoning. On
the other hand, it seems like we get rid of the compile time explosion
seen in PR51869 that way. Hence this patch.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D112080
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
The file was addedllvm/test/Analysis/ScalarEvolution/pr51869-scalar-evolution-prove-implications-via-truncation.ll
Commit 57553ce43281a7c379e375161320cc09d8236839 by zequanwu
Revert "Reland [clang] Pass -clear-ast-before-backend in Clang::ConstructJob()"

This reverts commit 1fb24fe85a19ae71b00875ff6c96ef1831dcf7e3.

This causes clang crash on chromium. See repro at https://bugs.chromium.org/p/chromium/issues/detail?id=1261551#c1.
The file was modifiedclang/lib/Interpreter/Interpreter.cpp
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
Commit 9c44a0996c8cf87607807751be2315020c582c66 by bjorn.a.pettersson
[SCEV] Fix formatting error introduced by D112080

Accidentally pushed D112080 without this clang-format cleanup.
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp