[PATCH] D32688: [Coverage] Comdat section name should be same as the variable name in COFF format

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 15:17:30 PDT 2017


rnk added a comment.

Are we sure we want it like this? Doesn't this retain instrprof data structures from both A.obj and B.obj for inline functions present in both objs? Won't that be a problem?

>> From @davidxl :
> 
> It was comdat associated with the function before -- but it was wrong. The problem is that different comdat functions may have different CFGs (due to different early inlining), leading to incompatible profile counter data. Note that a comdat function can be later inlined, so using a shared copy of profile counter will be bad (out of bound access, not to mention profile use phase can not use it).

I agree, if instrprof runs before inlining, then we don't want these to be in a comdat group with the function. It's not safe for other functions to reference the data after inlining.

However, if instrprof runs after "early inlining", which I didn't think we had any of, then how have we solved the problem of different comdat functions having different CFGs at instrumentation time?


https://reviews.llvm.org/D32688





More information about the llvm-commits mailing list