Intrinsic calls like llvm.dbg.value() should not be considered as viable candidates for inlining.
Before this patch, we always called method 'findCalleeFunctionSamples()' on intrinsic calls.
However, an intrinsic call (for example: a @llvm.dbg.value()) can have the same debug location of another function F which, according to the sample profile, was originally inlined.
In that scenario, method 'findCalleeFunctionSamples()' would return a non-null pointer, and the algorithm would end up adding the intrinsic call to the 'Candidates' set.
As a side note: I noticed that Dehao created D31950. With that patch, intrinsic calls would not be added to the Candidates set, because that patch would introduce a check on the function name.
That said, in the case of intrinsic calls, we shouldn't even call 'findCalleeFunctionSamples()', since intrinsic calls cannot be considered as viable inlining candidates fof obvious reasons.
Please let me know if okay to commit.
Thanks,
Andrea