[llvm-profgen][CSSPGO] On-demand function size computation for preinliner
authorwlei <wlei@fb.com>
Sat, 25 Sep 2021 01:16:36 +0000 (18:16 -0700)
committerwlei <wlei@fb.com>
Tue, 28 Sep 2021 16:09:38 +0000 (09:09 -0700)
commitce40843a3fe120621bb6e4aa07dc9cbf76b6aa0e
tree8e90c8fc47f83a3866e89ba24517da570e182e07
parent091c16f76ba1e6341afd717445323f8396b7772f
[llvm-profgen][CSSPGO] On-demand function size computation for preinliner

Similar to https://reviews.llvm.org/D110465, we can compute function size on-demand for the functions that's hit by samples.

Here we leverage the raw range samples' address to compute a set of sample hit function. Then `BinarySizeContextTracker` just works on those function range for the size.

Reviewed By: hoy

Differential Revision: https://reviews.llvm.org/D110466
llvm/tools/llvm-profgen/ProfileGenerator.cpp
llvm/tools/llvm-profgen/ProfileGenerator.h
llvm/tools/llvm-profgen/ProfiledBinary.cpp
llvm/tools/llvm-profgen/ProfiledBinary.h