This is an archive of the discontinued LLVM Phabricator instance.

[IRGen] Add !annotation metadata for auto-init stores.
ClosedPublic

Authored by fhahn on Nov 13 2020, 5:34 AM.

Details

Summary

This patch updates Clang's IRGen to add !annotation nodes with an
"auto-init" annotation to all stores for auto-initialization.

As discussed in 'RFC: Combining Annotation Metadata and Remarks'
(http://lists.llvm.org/pipermail/llvm-dev/2020-November/146393.html)
this allows using optimization remarks to track down where auto-init
code was inserted (and not removed by optimizations).

There are a few cases in the tests where !annotation gets dropped by
optimizations. Those optimizations will be updated in subsequent
patches.

This patch is based on a patch by Francis Visoiu Mistrih.

Diff Detail

Event Timeline

fhahn created this revision.Nov 13 2020, 5:34 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 13 2020, 5:34 AM
fhahn requested review of this revision.Nov 13 2020, 5:34 AM
paquette accepted this revision.Nov 13 2020, 1:49 PM

I think this looks reasonable.

This revision is now accepted and ready to land.Nov 13 2020, 1:49 PM
jdoerfert added inline comments.Nov 13 2020, 1:57 PM
clang/lib/CodeGen/CGDecl.cpp
1268–1269

Nit: /* AutoInit */ also other places

thegameg accepted this revision.Nov 13 2020, 3:44 PM

Looks good, thanks!

fhahn added a reviewer: jfb.Nov 16 2020, 2:29 AM
fhahn added inline comments.Nov 16 2020, 2:39 AM
clang/lib/CodeGen/CGDecl.cpp
1268–1269

Thanks, I added a comment to all places where constants are passed.

This revision was landed with ongoing or failed builds.Nov 16 2020, 2:42 AM
This revision was automatically updated to reflect the committed changes.