[InstrProf][NFC] Save profile bias to function map
authorEllis Hoag <ellis.sparky.hoag@gmail.com>
Mon, 16 May 2022 14:13:07 +0000 (07:13 -0700)
committerEllis Hoag <ellis.sparky.hoag@gmail.com>
Mon, 16 May 2022 15:32:31 +0000 (08:32 -0700)
commit6e23cd2bf073ab5eb5a103b935af54046d007c52
treef820a65f429d8ddda84cbbf35a8af6172f2929e1
parentbe7f09f7b2e83ca4aebb3bdbb83ad1d19662b993
[InstrProf][NFC] Save profile bias to function map

Add a map from functions to load instructions that compute the profile bias. Previously we assumed that if the first instruction in the function was a load instruction, then it must be computing the bias. This was likely to work out because functions usually start with the `llvm.instrprof.increment` instruction, but optimizations could change this. For example, inlining into a non-profiled function.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D114319
llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h
llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp