SuccessChanges

Summary

  1. [CMake] Simplify CMake handling for zlib (details)
  2. Revert "[CMake] Simplify CMake handling for zlib" (details)
  3. [llvm-profdata] Implement llvm-profdata overlap for sample profiles (details)
Commit ccbc1485b55ff4acd21bcfafbf7aec4ed0fd818d by phosek
[CMake] Simplify CMake handling for zlib

Rather than handling zlib handling manually, use find_package from CMake
to find zlib properly. Use this to normalize the LLVM_ENABLE_ZLIB,
HAVE_ZLIB, HAVE_ZLIB_H. Furthermore, require zlib if LLVM_ENABLE_ZLIB is
set to YES, which requires the distributor to explicitly select whether
zlib is enabled or not. This simplifies the CMake handling and usage in
the rest of the tooling.

This is a reland of abb0075 with all followup changes and fixes that
should address issues that were reported in PR44780.

Differential Revision: https://reviews.llvm.org/D79219
The file was modifiedllvm/lib/Support/Compression.cpp
The file was modifiedllvm/test/CMakeLists.txt
The file was modifiedclang/test/lit.site.cfg.py.in
The file was modifiedlldb/cmake/modules/LLDBStandalone.cmake
The file was modifiedllvm/lib/Support/CRC.cpp
The file was modifiedllvm/test/lit.site.cfg.py.in
The file was modifiedllvm/utils/gn/secondary/llvm/test/BUILD.gn
The file was modifiedllvm/cmake/modules/LLVMConfig.cmake.in
The file was modifiedllvm/include/llvm/Config/config.h.cmake
The file was modifiedllvm/unittests/Support/CompressionTest.cpp
The file was modifiedllvm/utils/gn/secondary/clang/test/BUILD.gn
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
The file was modifiedllvm/utils/gn/secondary/compiler-rt/test/BUILD.gn
The file was modifiedcompiler-rt/test/lit.common.configured.in
The file was modifiedlld/test/CMakeLists.txt
The file was modifiedllvm/utils/gn/secondary/lld/test/BUILD.gn
The file was modifiedllvm/lib/Support/CMakeLists.txt
The file was modifiedclang/test/CMakeLists.txt
The file was modifiedlld/test/lit.site.cfg.py.in
The file was modifiedllvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
The file was modifiedllvm/cmake/config-ix.cmake
Commit a4d78d23c53451ccefe0df0adfff9a1ac3077f10 by phosek
Revert "[CMake] Simplify CMake handling for zlib"

This reverts commit ccbc1485b55ff4acd21bcfafbf7aec4ed0fd818d which
is still failing on the Windows MLIR bots.
The file was modifiedclang/test/lit.site.cfg.py.in
The file was modifiedllvm/utils/gn/secondary/lld/test/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
The file was modifiedllvm/lib/Support/Compression.cpp
The file was modifiedllvm/utils/gn/secondary/clang/test/BUILD.gn
The file was modifiedllvm/include/llvm/Config/config.h.cmake
The file was modifiedllvm/cmake/config-ix.cmake
The file was modifiedllvm/lib/Support/CRC.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
The file was modifiedcompiler-rt/test/lit.common.configured.in
The file was modifiedllvm/unittests/Support/CompressionTest.cpp
The file was modifiedclang/test/CMakeLists.txt
The file was modifiedllvm/test/lit.site.cfg.py.in
The file was modifiedllvm/utils/gn/secondary/llvm/test/BUILD.gn
The file was modifiedllvm/test/CMakeLists.txt
The file was modifiedlld/test/CMakeLists.txt
The file was modifiedllvm/utils/gn/secondary/compiler-rt/test/BUILD.gn
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
The file was modifiedllvm/lib/Support/CMakeLists.txt
The file was modifiedlld/test/lit.site.cfg.py.in
The file was modifiedllvm/cmake/modules/LLVMConfig.cmake.in
The file was modifiedlldb/cmake/modules/LLDBStandalone.cmake
Commit 540489de6816486f98221952d7a54f0293c68d1e by aktoon
[llvm-profdata] Implement llvm-profdata overlap for sample profiles

Implemented the `llvm-profdata overlap` feature for sample profiles. It reports weighted //similarity// and unweighted //overlap// metrics at program and function level for two input profiles. Similarity metrics are symmetric with regards to the order of two input profiles. By default, the tool only reports program-level summary. Users can look into function-level details via additional options `--function`, `--similarity-cutoff`, and `--value-cutoff`.

The similarity metrics are designed as follows:
* Program-level summary
    * Whole program profile similarity is an aggregate over function-level similarity `FS`: `PS = sum(FS(A) * avg_weight(A))` for all function `A`.
    * Whole program sample overlap: `PSO = common_samples / total_samples`.
    * Function overlap: `FO = #common_function / #total_function`.
    * Hot-function overlap: `HFO = #common_hot_function / #total_hot_function`.
    * Hot-block overlap: `HBO = #common_hot_block / #total_hot_block`.
* Function-level details
    * Function-level similarity is an aggregate over line/block-level similarities `BS` of all sample lines/blocks in the function, weighted by the closeness of the function's weights in two profiles: `FS = sum(BS(i)) * (1 - weight_distance(A))`.
    * Function-level sample overlap: `FSO = common_samples / total_samples` for samples in the function.

Reviewed By: wenlei, hoyFB, wmi

Differential Revision: https://reviews.llvm.org/D83852
The file was addedllvm/test/tools/llvm-profdata/Inputs/sample-overlap-5.proftext
The file was addedllvm/test/tools/llvm-profdata/Inputs/sample-overlap-3.proftext
The file was addedllvm/test/tools/llvm-profdata/Inputs/sample-overlap-2.proftext
The file was addedllvm/test/tools/llvm-profdata/sample-overlap.test
The file was addedllvm/test/tools/llvm-profdata/Inputs/sample-overlap-0.proftext
The file was addedllvm/test/tools/llvm-profdata/Inputs/sample-overlap-4.proftext
The file was modifiedllvm/tools/llvm-profdata/llvm-profdata.cpp
The file was addedllvm/test/tools/llvm-profdata/Inputs/sample-overlap-1.proftext