- Introduce option to preserve indirect callsites with value profiles, with default value false to keep existing behavior.
- The planned usage is to turn on this option to true in LTO prelink pipelines in a PGO build.
- [Why] Before MD_prof metadata is used, two different callsites with MD_prof shouldn't be simplified to one.
- Merge branch_weights on direct callsites.
IR test cases are generated based on two C++ code with manually-annotated !prof metadata
- hoist of indirect call https://gcc.godbolt.org/z/o6G68rn3v
- sink of direct call https://gcc.godbolt.org/z/79E3onono
- C++ comments and test cases have brief comments to explain why/when not preserving is sub-optimal.
Suggest undoing this change which just moves the comment a little but unnecessarily adds a diff.