This is an archive of the discontinued LLVM Phabricator instance.

[PGO] Revisied patch: Differentiate Clang instrumentation and IR level instrumentation profiles
ClosedPublic

Authored by xur on Feb 8 2016, 10:11 PM.

Details

Summary

The original review is: Differential Revision: http://reviews.llvm.org/D15540

I reverted the commit r260164 because it broke one darwin test in compile-rt/profile/

The reason for the breakage is Mach-O platform doesn’t support COMDATs. In this revised patch, I create a linkonce variable for the MachO platform and remain to create a comdat variable for other platforms.

I change the test Transform/PGOInstrumentation/branch1.ll to test linkonce variable creation.

Other part of the patch is the same.

Tested the patch in Marbook pro and Linux.

Thanks,

-Rong

Diff Detail

Repository
rL LLVM

Event Timeline

xur updated this revision to Diff 47296.Feb 8 2016, 10:11 PM
xur retitled this revision from to [PGO] Revisied patch: Differentiate Clang instrumentation and IR level instrumentation profiles.
xur updated this object.
xur added reviewers: davidxl, silvas, bogner.
xur added subscribers: llvm-commits, t.p.northover.
davidxl added inline comments.Feb 9 2016, 10:33 AM
lib/Transforms/Instrumentation/PGOInstrumentation.cpp
729 ↗(On Diff #47296)

Why not linkonceODR -- the version var generated in each TU needs to be the same.

733 ↗(On Diff #47296)

Remove this comment line.

xur updated this revision to Diff 47339.Feb 9 2016, 10:46 AM
xur marked 2 inline comments as done.

uploaded the new patch integrated David's comments.

Hi Rong,

Thanks for fixing the issue. I've checked on my local machines and I think this one works fine on Darwin.

Tim.

davidxl accepted this revision.Feb 10 2016, 12:01 AM
davidxl edited edge metadata.

lgtm

This revision is now accepted and ready to land.Feb 10 2016, 12:01 AM
This revision was automatically updated to reflect the committed changes.