This is an archive of the discontinued LLVM Phabricator instance.

Fix PR28219: Use profile summary from reader and not compute it
ClosedPublic

Authored by eraman on Jun 20 2016, 6:33 PM.

Details

Summary

This fixes the root cause of PR28219 - profile summar metadata mismatch in LTO mode. This probably needs an LTO test too - what would be the right place to have it?

Diff Detail

Event Timeline

eraman updated this revision to Diff 61333.Jun 20 2016, 6:33 PM
eraman retitled this revision from to Fix PR28219: Use profile summary from reader and not compute it.
eraman updated this object.
eraman added reviewers: davidxl, JakeVanAdrighem.
eraman added a subscriber: llvm-commits.
jakev added a subscriber: jakev.Jun 20 2016, 8:14 PM

So even after applying this patch, IRMover is still emitting an error. I
believe the root cause of this is that we do a pointer based comparison of
the metadata values. This has worked until now when we have constant values
because we unique them in the IR, but doesn't for the ProfileSummary value
which references another metadata entry. If you could, please take a look
and let me know if I'm seeing things correctly.

Scratch that, please ignore my previous comment. My own naivety and an IR file with stale ProfileSummary info in the build was causing the error. This patch does in fact fix the problem when not using IR/bitcode files in that way.

davidxl accepted this revision.Jun 21 2016, 9:17 AM
davidxl edited edge metadata.

lgtm

This revision is now accepted and ready to land.Jun 21 2016, 9:17 AM
eraman closed this revision.Jun 24 2016, 10:17 AM