[PATCH] D36440: [ThinLTO] Fix thinLTO crash

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 16:34:52 PDT 2017


tejohnson accepted this revision.
tejohnson added a comment.
This revision is now accepted and ready to land.

In https://reviews.llvm.org/D36440#838780, @davidxl wrote:

> got time to look at it more.  The root cause of why the call resolves to a static variable in another module is from the following code in BitcodeWriter.cpp.   The call to ::link was recorded to GUID: 14802282251123568682 which was correct. Since it does not have a value-id, the logic for sample PGO kicks in. 14802282251123568682 was treated as 'original guid' and the from the map, the PGO annotated GUID for the static var was found (note that one original guid maps to multiple GUIDs).  After this, the call to :link now resolves to static var 'link's GUID.


I guess for sample PGO it will essentially guess as to which local with a matching original GUID is the intended one.

This fix LGTM, but please add a comment about how this is required because in this case there can be multiple matches with the original GUID, and we may pick wrong.


https://reviews.llvm.org/D36440





More information about the llvm-commits mailing list