Changes

Summary

  1. [libcxx][NFC] Make sequence containers slightly more SFINAE-friendly during CTAD. (details)
  2. [libc++] [test] C++03-friendly MAKE_STRING macro. (details)
  3. [libc++] [test] C++14/17-friendly `TEST_IS_CONSTANT_EVALUATED` macro. (details)
  4. [libc++] [test] Refactor string_view comparison tests for comprehensiveness. (details)
  5. [GlobalOpt] Simplify CleanupConstantGlobalUsers() (details)
  6. Fix false positives in `fuchsia-trailing-return` check involving deduction guides (details)
  7. [DSE] Add libcall tests for functions only available on Darwin. (details)
  8. [TLI checker] Update for post-commit review comments (details)
  9. AMDGPU/GlobalISel: Fix constant bus restriction errors for med3 (details)
  10. [libcxx][modularisation] modularises <numeric> header (details)
  11. [gn build] Port a0efb1750065 (details)
  12. [TLI] Add memset_pattern4, memset_pattern8 lib functions. (details)
  13. [Analyzer][solver] Simplification: Do a fixpoint iteration before the eq class merge (details)
  14. [flang] Don't close stderr in runtime (fixes STOP output) (details)
  15. [mlir] Remove extractVectorTypeFromShapedValue (details)
  16. [NFC][sanitizer] constexpr in sanitizer_dense_map_info (details)
  17. [libc++] Make __wrap_iter constexpr (details)
  18. [sanitizer] Implement MprotectReadOnly and MprotectNoAccess (details)
  19. [libcxx][test][NFC] Various tests for std::vector (details)
  20. profi - a flow-based profile inference algorithm: Part I (out of 3) (details)
  21. [gn build] Port 7cc2493daaf5 (details)
  22. [Cloning] Clone metadata on function declarations (details)
  23. [llvm-reduce] Assert that the number of chunks does not change with reductions (details)
  24. [TSan][Darwin] Mark test unsupported (details)
  25. [llvm] [Support] Add HTTP Client Support library. (details)
  26. [gn build] Port 170783f991fa (details)
  27. [clang-tidy] Use `hasCanonicalType()` matcher in `bugprone-unused-raii` check (details)
  28. [lldb] Split TestCxxChar8_t (details)
  29. [TSan][Darwin] Prevent inlining of functions in tests (details)
  30. Revert "[sanitizer] Add compress_stack_depot flag" (details)
  31. [unroll] Fix a functional change in an NFC patch (details)
  32. Revert "[VE] Make VE official" (details)
  33. [mlir][linalg][bufferize] Bufferization of tensor.insert (details)
Commit 7da4ee6f23dd14464ee869caec18b5421d1cf7ca by varconst
[libcxx][NFC] Make sequence containers slightly more SFINAE-friendly during CTAD.

Disable the constructors taking `(size_type, const value_type&,
allocator_type)` if `allocator_type` is not a valid allocator.
Otherwise, these constructors are considered when resolving e.g.
`(int*, int*, NotAnAllocator())`, leading to a hard error during
instantiation. A hard error makes the Standard's requirement to not
consider deduction guides of the form `(Iterator, Iterator,
BadAllocator)` during overload resolution essentially non-functional.

The previous approach was to SFINAE away `allocator_traits`. This patch
SFINAEs away the specific constructors instead, for consistency with
`basic_string` -- see [LWG3076](wg21.link/lwg3076) which describes
a very similar problem for strings (note, however, that unlike LWG3076,
no valid constructor call is affected by the bad instantiation).

Differential Revision: https://reviews.llvm.org/D114311
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
The file was modifiedlibcxx/include/vector
The file was modifiedlibcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
The file was modifiedlibcxx/include/__memory/allocator_traits.h
The file was modifiedlibcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
The file was modifiedlibcxx/include/deque
The file was modifiedlibcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
The file was modifiedlibcxx/include/forward_list
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp
The file was modifiedlibcxx/include/list
The file was modifiedlibcxx/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
Commit a0b50c56d15273dc8e6475e826cac7f03c39d51f by arthur.j.odwyer
[libc++] [test] C++03-friendly MAKE_STRING macro.

Reviewed as part of D114658.
The file was modifiedlibcxx/test/support/make_string.h
Commit b4a13e4c9835362b40f87350b2efba3e1eaad2be by arthur.j.odwyer
[libc++] [test] C++14/17-friendly `TEST_IS_CONSTANT_EVALUATED` macro.

Reviewed as part of D114658.
Ultimately this will probably have to be flipped around and renamed
`TEST_IS_RUNTIME`, and extended with `TEST_IS_RUNTIME_OR_CXX20` (once
constexpr std::string support is added) and so on for every new C++
version. But we don't need that flexibility yet, so we're not adding it.
The file was modifiedlibcxx/test/support/test_macros.h
Commit 0efd9a03fa643fad42b222c9fb8a417da3f5b0d6 by arthur.j.odwyer
[libc++] [test] Refactor string_view comparison tests for comprehensiveness.

Differential Revision: https://reviews.llvm.org/D114658
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp
The file was addedlibcxx/test/std/strings/string.view/string.view.comparison/less_equal.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/opge.string_view.string.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/opne.string_view.string.pass.cpp
The file was addedlibcxx/test/std/strings/string.view/string.view.comparison/greater_equal.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/oplt.string_view.string.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp
The file was addedlibcxx/test/std/strings/string.view/string.view.comparison/greater.pass.cpp
The file was addedlibcxx/test/std/strings/string.view/string.view.comparison/not_equal.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/opgt.string_view.string.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/opeq.string_view.string.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp
The file was addedlibcxx/test/std/strings/string.view/string.view.comparison/less.pass.cpp
The file was removedlibcxx/test/std/strings/string.view/string.view.comparison/ople.string_view.string.pass.cpp
The file was addedlibcxx/test/std/strings/string.view/string.view.comparison/equal.pass.cpp
Commit 8d1759c404c7899c62d6ed89791e49b2742c1a20 by nikita.ppv
[GlobalOpt] Simplify CleanupConstantGlobalUsers()

This bases the CleanupConstantGlobalUsers() implementation around
the ConstantFoldLoadFromConst() API. The general approach is that
we discover all users while looking through casts, and then
constant fold loads and drop stores and memintrinsics.

This avoids special cases and limitations in the previous
implementation, which is also incompatible with opaque pointers.
The result is a bit more powerful than before, because we now use
more general load folding logic which can for example look through
pointer bitcasts between different sizes. This is where the test
changes come from, as we now fold more loads and can thus remove
more globals.

Differential Revision: https://reviews.llvm.org/D114889
The file was modifiedllvm/lib/Transforms/IPO/GlobalOpt.cpp
The file was modifiedllvm/test/Transforms/GlobalOpt/atomic.ll
The file was modifiedllvm/test/Transforms/GlobalOpt/address_space_initializer.ll
The file was modifiedllvm/test/Transforms/GlobalOpt/const-return-status-atomic.ll
Commit 844a8d3cecb4cc40e5d9694bcf111518910ea2ff by aaron
Fix false positives in `fuchsia-trailing-return` check involving deduction guides

Fixes PR#47614. Deduction guides, implicit or user-defined, look like
function declarations in the AST. They aren't really functions, though,
and they always have a trailing return type, so it doesn't make sense
to issue this warning for them.
The file was modifiedclang-tools-extra/docs/ReleaseNotes.rst
The file was modifiedclang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/fuchsia-trailing-return.cpp
Commit 5fe151f98f02b2ab5543476d44c2f3dd52b01aa7 by flo
[DSE] Add libcall tests for functions only available on Darwin.

Add a set of tests for memset_pattern{4,8,16} variants.
The file was addedllvm/test/Transforms/DeadStoreElimination/libcalls-darwin.ll
Commit 66071f440c31b95cb2514a8daa003b62882b8245 by paul.robinson
[TLI checker] Update for post-commit review comments

Ignore undefined symbols; other minor code cleanup.
Replace test objects and their asm source with a yaml equivalent.

Differential Revision: https://reviews.llvm.org/D114478
The file was removedllvm/test/tools/llvm-tli-checker/Inputs/ps4-tli-check.right.so
The file was modifiedllvm/tools/llvm-tli-checker/llvm-tli-checker.cpp
The file was removedllvm/test/tools/llvm-tli-checker/ps4-tli-check.s
The file was removedllvm/test/tools/llvm-tli-checker/Inputs/ps4-tli-check.wrong.so
The file was addedllvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
Commit 641906da8de2f131a433ec26d7fd44ee74abfa5b by petar.avramovic
AMDGPU/GlobalISel: Fix constant bus restriction errors for med3

Detected on targets older then gfx10 (e.g. gfx9) for constants that are
too large to be inlined (constant are sgpr by default).
In med3 combine it is expected that regbankselect maps all operands of
min/max we try to match to vgpr. However constants are mapped to sgpr
and there will be a sgpr-to-vgpr copy. Matchers look through sgpr-to-vgpr
copies and return sgpr and these break constant bus restriction.
Build med3 with all vgpr operands. Use existing sgpr-to-vgpr copies for
matched sgprs. If there is no such copy (not expected) build one.

Differential Revision: https://reviews.llvm.org/D114700
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/regbankcombiner-smed3.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/regbankcombiner-umed3.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/smed3.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/umed3.ll
Commit a0efb1750065cb51b98f8ef10f07cef8dde7f3a0 by cjdb
[libcxx][modularisation] modularises <numeric> header

Differential Revision: https://reviews.llvm.org/D114836
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/numeric/inclusive_scan.module.verify.cpp
The file was addedlibcxx/include/__numeric/inner_product.h
The file was modifiedlibcxx/include/CMakeLists.txt
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/numeric/adjacent_difference.module.verify.cpp
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/numeric/transform_inclusive_scan.module.verify.cpp
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/numeric/transform_reduce.module.verify.cpp
The file was addedlibcxx/include/__numeric/accumulate.h
The file was addedlibcxx/include/__numeric/exclusive_scan.h
The file was addedlibcxx/include/__numeric/inclusive_scan.h
The file was addedlibcxx/include/__numeric/transform_reduce.h
The file was addedlibcxx/include/__numeric/gcd_lcm.h
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/numeric/exclusive_scan.module.verify.cpp
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/numeric/reduce.module.verify.cpp
The file was addedlibcxx/include/__numeric/transform_exclusive_scan.h
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/numeric/transform_exclusive_scan.module.verify.cpp
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/numeric/midpoint.module.verify.cpp
The file was addedlibcxx/include/__numeric/adjacent_difference.h
The file was addedlibcxx/include/__numeric/partial_sum.h
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/numeric/inner_product.module.verify.cpp
The file was addedlibcxx/include/__numeric/iota.h
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/numeric/accumulate.module.verify.cpp
The file was addedlibcxx/include/__numeric/transform_inclusive_scan.h
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/numeric/iota.module.verify.cpp
The file was addedlibcxx/include/__numeric/midpoint.h
The file was modifiedlibcxx/include/module.modulemap
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/numeric/partial_sum.module.verify.cpp
The file was addedlibcxx/include/__numeric/reduce.h
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/numeric/gcd_lcm.module.verify.cpp
The file was modifiedlibcxx/include/numeric
Commit bab21a46283f62ffd0c7e315b9007d96aa3dfaf7 by llvmgnsyncbot
[gn build] Port a0efb1750065
The file was modifiedllvm/utils/gn/secondary/libcxx/include/BUILD.gn
Commit ad88a37ceadb5e1f8f3cb9beb5abacf2c1bb9869 by flo
[TLI] Add memset_pattern4, memset_pattern8 lib functions.

Similar to memset_pattern16, memset_pattern4, memset_pattern8 are
available on Darwin platforms.

https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/memset_pattern4.3.html

Reviewed By: ab

Differential Revision: https://reviews.llvm.org/D114881
The file was modifiedllvm/unittests/Analysis/TargetLibraryInfoTest.cpp
The file was modifiedllvm/lib/Analysis/TargetLibraryInfo.cpp
The file was modifiedllvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
The file was modifiedllvm/include/llvm/Analysis/TargetLibraryInfo.def
Commit 20f8733d4b8d5bdb93080b8824de57b7fae31785 by gabor.marton
[Analyzer][solver] Simplification: Do a fixpoint iteration before the eq class merge

This reverts commit f02c5f3478318075d1a469203900e452ba651421 and
addresses the issue mentioned in D114619 differently.

Repeating the issue here:
Currently, during symbol simplification we remove the original member
symbol from the equivalence class (`ClassMembers` trait). However, we
keep the reverse link (`ClassMap` trait), in order to be able the query
the related constraints even for the old member. This asymmetry can lead
to a problem when we merge equivalence classes:
```
ClassA: [a, b]   // ClassMembers trait,
a->a, b->a       // ClassMap trait, a is the representative symbol
```
Now let,s delete `a`:
```
ClassA: [b]
a->a, b->a
```
Let's merge ClassA into the trivial class `c`:
```
ClassA: [c, b]
c->c, b->c, a->a
```
Now, after the merge operation, `c` and `a` are actually in different
equivalence classes, which is inconsistent.

This issue manifests in a test case (added in D103317):
```
void recurring_symbol(int b) {
  if (b * b != b)
    if ((b * b) * b * b != (b * b) * b)
      if (b * b == 1)
}
```
Before the simplification we have these equivalence classes:
```
trivial EQ1: [b * b != b]
trivial EQ2: [(b * b) * b * b != (b * b) * b]
```

During the simplification with `b * b == 1`, EQ1 is merged with `1 != b`
`EQ1: [b * b != b, 1 != b]` and we remove the complex symbol, so
`EQ1: [1 != b]`
Then we start to simplify the only symbol in EQ2:
`(b * b) * b * b != (b * b) * b --> 1 * b * b != 1 * b --> b * b != b`
But `b * b != b` is such a symbol that had been removed previously from
EQ1, thus we reach the above mentioned inconsistency.

This patch addresses the issue by making it impossible to synthesise a
symbol that had been simplified before. We achieve this by simplifying
the given symbol to the absolute simplest form.

Differential Revision: https://reviews.llvm.org/D114887
The file was modifiedclang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
The file was modifiedclang/test/Analysis/symbol-simplification-fixpoint-one-iteration.cpp
The file was modifiedclang/test/Analysis/symbol-simplification-disequality-info.cpp
The file was modifiedclang/test/Analysis/expr-inspection-printState-eq-classes.c
The file was modifiedclang/test/Analysis/symbol-simplification-fixpoint-two-iterations.cpp
Commit 3f6dbf1a75b259e242116820aec040b4b72d9296 by pklausler
[flang] Don't close stderr in runtime (fixes STOP output)

STOP statement output was sometimes failing to appear because
the runtime flushes and shuts down open Fortran units beforehand.
But when file descriptor 2 was closed, the STOP statement output
was suppressed.  The fix is to not actually close file descriptors
0-2 if they are connected to Fortran units being closed.  This was
already the policy when an OPEN statement was (re-)opening such a
unit, so that logic has been pulled out into a member function and
shared with CLOSE processing.

Differential Revision: https://reviews.llvm.org/D114897
The file was modifiedflang/runtime/file.h
The file was modifiedflang/runtime/file.cpp
Commit afe43e071309e27547a07b0916eb8bdae1604106 by kazu
[mlir] Remove extractVectorTypeFromShapedValue

This patch fixes the build by removing
extractVectorTypeFromShapedValue.  The last use was removed Dec 1,
2021 in commit extractVectorTypeFromShapedValue.
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
Commit 86f48fbb1c312fdcd0c985fb578a4c0b70547e77 by Vitaly Buka
[NFC][sanitizer] constexpr in sanitizer_dense_map_info
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_dense_map_info.h
Commit 6146e4cf89dbd5d9627c4694e0bea9d4c0fc6e0b by nikolasklauser
[libc++] Make __wrap_iter constexpr

`__wrap_iter` is currently only constexpr if it's not a debug built, but it isn't used in a constexpr context currently. Making it always constexpr and disabling the debugging utilities at constant evaluation is more usful since it has to be always constexpr to be used in a constexpr context.

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D114733
The file was modifiedlibcxx/include/__config
The file was modifiedlibcxx/include/__iterator/wrap_iter.h
Commit e599aa80c085559a5449bbd61a96da63d481aa6c by Vitaly Buka
[sanitizer] Implement MprotectReadOnly and MprotectNoAccess

MprotectReadOnly for Win and Fuchsia
MprotectNoAccess for Fuchsia
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_win.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cpp
Commit 8c6b24899e51648286bb812d92a23a28798c53eb by ruslan.arutyunyan
[libcxx][test][NFC] Various tests for std::vector

Add missing tests for std::vector funcionality to improve code coverage:

  - Rewrote access tests to check modification of the container using
    the reference returned by the non-const overload
  - Added tests for reverse iterators: rbegin, rend, etc.
  - Added exception test for vector::reserve
  - Extended test cases for vector copy assignment
  - Fixed insert_iter_value.pass.cpp to use insert overload with const
    value_type& (not with value_type&& which is tested in
    iter_rvalue.pass.cpp test)

Reviewed By: Quuxplusone, rarutyun, #libc

Differential Revision: https://reviews.llvm.org/D112438
The file was modifiedlibcxx/test/std/containers/sequences/vector/access.pass.cpp
The file was removedlibcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp
The file was addedlibcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_lvalue.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
The file was modifiedlibcxx/test/support/allocators.h
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.cons/assign_copy.pass.cpp
The file was addedlibcxx/test/std/containers/sequences/vector/reverse_iterators.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
Commit 7cc2493daaf549f2e8bf899a34e3326884104afe by hoy
profi - a flow-based profile inference algorithm: Part I (out of 3)

The benefits of sampling-based PGO crucially depends on the quality of profile
data. This diff implements a flow-based algorithm, called profi, that helps to
overcome the inaccuracies in a profile after it is collected.

Profi is an extended and significantly re-engineered classic MCMF (min-cost
max-flow) approach suggested by Levin, Newman, and Haber [2008, Complementing
missing and inaccurate profiling using a minimum cost circulation algorithm]. It
models profile inference as an optimization problem on a control-flow graph with
the objectives and constraints capturing the desired properties of profile data.
Three important challenges that are being solved by profi:
- "fixing" errors in profiles caused by sampling;
- converting basic block counts to edge frequencies (branch probabilities);
- dealing with "dangling" blocks having no samples in the profile.

The main implementation (and required docs) are in SampleProfileInference.cpp.
The worst-time complexity is quadratic in the number of blocks in a function,
O(|V|^2). However a careful engineering and extensive evaluation shows that
the running time is (slightly) super-linear. In particular, instances with
1000 blocks are solved within 0.1 second.

The algorithm has been extensively tested internally on prod workloads,
significantly improving the quality of generated profile data and providing
speedups in the range from 0% to 5%. For "smaller" benchmarks (SPEC06/17), it
generally improves the performance (with a few outliers) but extra work in
the compiler might be needed to re-tune existing optimization passes relying on
profile counts.

UPD Dec 1st 2021:
- synced the declaration and definition of the option `SampleProfileUseProfi ` to use type `cl::opt<bool`;
- added `inline` for `SampleProfileInference<BT>::findUnlikelyJumps` and `SampleProfileInference<BT>::isExit` to avoid linking problems on windows.

Reviewed By: wenlei, hoy

Differential Revision: https://reviews.llvm.org/D109860
The file was addedllvm/test/Transforms/SampleProfile/Inputs/profile-inference.prof
The file was addedllvm/test/Transforms/SampleProfile/profile-inference.ll
The file was modifiedllvm/lib/Transforms/IPO/SampleProfile.cpp
The file was addedllvm/lib/Transforms/Utils/SampleProfileInference.cpp
The file was modifiedllvm/lib/Transforms/Utils/SampleProfileLoaderBaseUtil.cpp
The file was modifiedllvm/lib/Transforms/Utils/CMakeLists.txt
The file was addedllvm/include/llvm/Transforms/Utils/SampleProfileInference.h
The file was modifiedllvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
Commit 1b7150c8f89a917094ddc8fe7a6304ae3464e8c4 by llvmgnsyncbot
[gn build] Port 7cc2493daaf5
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Transforms/Utils/BUILD.gn
Commit 512534bc16d2bebb0fb02e92a5ebd35eff9fb220 by aeubanks
[Cloning] Clone metadata on function declarations

Previously we missed cloning metadata on function declarations because
we don't call CloneFunctionInto() on declarations in CloneModule().

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D113812
The file was modifiedllvm/unittests/Transforms/Utils/CloningTest.cpp
The file was modifiedllvm/lib/Transforms/Utils/CloneModule.cpp
Commit 7cbb6e9a8f6ff3dff4b0353dfcbbdabab8865228 by aeubanks
[llvm-reduce] Assert that the number of chunks does not change with reductions

Followup to D113537.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D113816
The file was modifiedllvm/tools/llvm-reduce/deltas/Delta.cpp
Commit 6703fe25b7c26742cb511ba0e6050173188dd2f1 by julian.lettner
[TSan][Darwin] Mark test unsupported
The file was modifiedcompiler-rt/test/tsan/on_exit.cpp
Commit 170783f991fab1e5480a5bdea5e1b26c27b9b452 by shutty
[llvm] [Support] Add HTTP Client Support library.

This patch implements a small HTTP client library consisting primarily of the `HTTPRequest`, `HTTPResponseHandler`, and `BufferedHTTPResponseHandler` classes. Unit tests of the `HTTPResponseHandler` and `BufferedHTTPResponseHandler` are included.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D112751
The file was addedllvm/include/llvm/Support/HTTPClient.h
The file was modifiedllvm/unittests/Support/CMakeLists.txt
The file was addedllvm/unittests/Support/HTTPClient.cpp
The file was modifiedllvm/lib/Support/CMakeLists.txt
The file was addedllvm/lib/Support/HTTPClient.cpp
Commit ab112c2964a228b5e80c2e601d8c640a44c4b652 by llvmgnsyncbot
[gn build] Port 170783f991fa
The file was modifiedllvm/utils/gn/secondary/llvm/unittests/Support/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn
Commit 987a21522f2c7d799d0c2a720b3315a4fb6d1e74 by fabian.wolff
[clang-tidy] Use `hasCanonicalType()` matcher in `bugprone-unused-raii` check

Fixes PR#52217.

Reviewed By: simon.giesecke

Differential Revision: https://reviews.llvm.org/D113429
The file was modifiedclang-tools-extra/clang-tidy/bugprone/UnusedRaiiCheck.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/bugprone-unused-raii.cpp
Commit 8f329cee423735c2767d3ba490e39db49f649c21 by Jonas Devlieghere
[lldb] Split TestCxxChar8_t

Split TestCxxChar8_t into two parts: one that check reading variables
without a process and another part with. This allows us to skip the
former on Apple Silicon, where lack of support for chained fix-ups
causes the test to fail.

Differential revision: https://reviews.llvm.org/D114819
The file was modifiedlldb/test/API/lang/cpp/char8_t/TestCxxChar8_t.py
Commit 863b117411d898f5a288f560c48d75bb145d39f6 by julian.lettner
[TSan][Darwin] Prevent inlining of functions in tests

Prevent inlining of functions so we can FileCheck the generated stack
traces.
The file was modifiedcompiler-rt/test/tsan/atexit5.cpp
The file was modifiedcompiler-rt/test/tsan/atexit4.cpp
Commit f9d585d0dd5751be302f33fd129bbd8c11641f54 by wanyu9511
Revert "[sanitizer] Add compress_stack_depot flag"

This is failing on clang-s390x-linux,
https://lab.llvm.org/buildbot/#/builders/94/builds/6748.
This reverts commit bf18253b0ee543f98119e5ab6a5b57d05c24d314.
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_flags.inc
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cpp
The file was removedcompiler-rt/test/sanitizer_common/TestCases/compress_stack_depot.cpp
Commit 54e21df973e154052e74a4516bbe28a81e75a922 by daniel_l_sanders
[unroll] Fix a functional change in an NFC patch

5c77aa2b917c [unroll] Use early return in shouldFullUnroll [nfc]
wasn't quite NFC since !(x <= y) is x > y rather than x >= y

Credit to Justin Bogner for spotting the bug

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D114894
The file was modifiedllvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
Commit 27c9e8b45b25614a92539ac6787dbb5670d950b3 by kda
Revert "[VE] Make VE official"

Breaks fast buildbot.

This reverts commit a9d1d00b865ab6f6e75dcd649362a7c5cf01d168.
The file was modifiedllvm/CMakeLists.txt
Commit 4479138de8e662f0dc64a92008b126f050e18b77 by springerm
[mlir][linalg][bufferize] Bufferization of tensor.insert

This is a lightweight operation, useful for writing unit tests. It will be utilized for testing in subsequent commits.

Differential Revision: https://reviews.llvm.org/D114693
The file was modifiedmlir/test/Dialect/Linalg/comprehensive-module-bufferize.mlir
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/TensorInterfaceImpl.cpp