This is an archive of the discontinued LLVM Phabricator instance.

[InstrProf] Fix promoter when using counter relocations
ClosedPublic

Authored by ellis on May 16 2022, 10:39 AM.

Details

Summary

When using counter relocations, two instructions are emitted to compute
the address of the counter variable.

%BiasAdd = add i64 ptrtoint <__profc_>, <__llvm_profile_counter_bias>
%Addr = inttoptr i64 %BiasAdd to i64*

When promoting a counter, these instructions might not be available in
the block, so we need to copy these instructions.

This fixes https://github.com/llvm/llvm-project/issues/55125

Diff Detail

Event Timeline

ellis created this revision.May 16 2022, 10:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2022, 10:39 AM
ellis published this revision for review.May 16 2022, 10:40 AM
ellis added reviewers: phosek, Florian, gulfem, davidxl.
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2022, 10:40 AM
phosek accepted this revision.May 16 2022, 2:13 PM

LGTM thanks for looking into this!

This revision is now accepted and ready to land.May 16 2022, 2:13 PM
This revision was landed with ongoing or failed builds.May 16 2022, 2:32 PM
This revision was automatically updated to reflect the committed changes.