This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Add interface to emit remarks in Attributor
ClosedPublic

Authored by jhuber6 on May 13 2021, 2:23 PM.

Details

Summary

This patch adds support for the Attributor to emit remarks on behalf of some
other pass. The attributor can now optionally take a callback function that
returns an OptimizationRemarkEmitter object when given a Function pointer. If
this is availible then a remark will be emitted for the corresponding pass
name.

Depends on D102197

Diff Detail

Event Timeline

jhuber6 created this revision.May 13 2021, 2:23 PM
jhuber6 requested review of this revision.May 13 2021, 2:23 PM
Herald added a reviewer: baziotis. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
sstefan1 accepted this revision.May 13 2021, 11:31 PM

Maybe we can have a test for this? Otherwise LGTM.

This revision is now accepted and ready to land.May 13 2021, 11:31 PM
thegameg accepted this revision.May 14 2021, 9:51 AM
thegameg added a subscriber: thegameg.

LGTM with a test.

jhuber6 updated this revision to Diff 345514.May 14 2021, 11:40 AM

Adding test.

jhuber6 updated this revision to Diff 347101.May 21 2021, 12:20 PM

Changing after D102824 changed the Attributor constructor and adding interface for function remarks from D102784.

jhuber6 updated this revision to Diff 350295.Jun 7 2021, 8:01 AM

Updating to handle the remarks from the replace globalization pass after it was changed to use the Attributor instead.

jhuber6 updated this revision to Diff 350303.Jun 7 2021, 8:20 AM

Artefacts in the diff for some reason.

jhuber6 updated this revision to Diff 352180.Jun 15 2021, 10:36 AM

Comments.

Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2021, 10:36 AM
jhuber6 updated this revision to Diff 352244.Jun 15 2021, 2:19 PM

Arcanist updated the wrong revision, fixing.

jhuber6 updated this revision to Diff 352530.Jun 16 2021, 1:10 PM

Changing remark if the allocation was from globalization. The message was a
little confusing since the programmer didn't explicitly allocate memory there.

jhuber6 updated this revision to Diff 352532.Jun 16 2021, 1:12 PM

Forgot to fix test.

jhuber6 updated this revision to Diff 352860.Jun 17 2021, 3:13 PM

Adding missed remark for variables that are potentially captured or freed.

This revision was landed with ongoing or failed builds.Jun 22 2021, 11:13 AM
This revision was automatically updated to reflect the committed changes.