Progress:
In progressChanges

Summary

  1. [llvm-profdata] Implement llvm-profdata overlap for sample profiles (details)
  2. [ELF] --wrap: don't leave the original symbol as SHN_UNDEF in .symtab or .dynsym (details)
  3. [NFC][StackSafety] noinline in alias tests (details)
  4. [NFC][StackSafety] Add index test (details)
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-3.proftext
The file was modifiedllvm/tools/llvm-profdata/llvm-profdata.cpp
The file was addedllvm/test/tools/llvm-profdata/Inputs/sample-overlap-0.proftext
The file was addedllvm/test/tools/llvm-profdata/Inputs/sample-overlap-1.proftext
The file was addedllvm/test/tools/llvm-profdata/Inputs/sample-overlap-5.proftext
The file was addedllvm/test/tools/llvm-profdata/Inputs/sample-overlap-4.proftext
The file was addedllvm/test/tools/llvm-profdata/sample-overlap.test
The file was addedllvm/test/tools/llvm-profdata/Inputs/sample-overlap-2.proftext
Commit 0334578edc60ad8a7455e7b76e41901376245b56 by i
[ELF] --wrap: don't leave the original symbol as SHN_UNDEF in .symtab or .dynsym
The file was modifiedlld/test/ELF/wrap-shlib-undefined.s
The file was modifiedlld/ELF/SymbolTable.cpp
Commit b317321545aacc03004a3e0c514f7474e9ece422 by Vitaly Buka
[NFC][StackSafety] noinline in alias tests
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa-alias.ll
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll
Commit 5fd49911db546cda6b35dffb6be440385e8d96d5 by Vitaly Buka
[NFC][StackSafety] Add index test

This directly covers generateParamAccessSummary
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/ipa.ll
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll