This is an archive of the discontinued LLVM Phabricator instance.

[Libomptarget] Add `cold` to KeepAlive attributes
ClosedPublic

Authored by jhuber6 on Jan 17 2022, 2:04 PM.

Details

Summary

This patch adds the cold attribute to the keepAlive functions in the
RTL. This dummy function exists to keep certain RTL calls alive without
them being optimized out, but it is never called and can be declared
cold. This also helps some erroneous remarks being given on this
function because it has weak linkage and cannot be made internal.

Diff Detail

Event Timeline

jhuber6 requested review of this revision.Jan 17 2022, 2:04 PM
jhuber6 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 17 2022, 2:04 PM
tianshilei1992 accepted this revision.Jan 17 2022, 2:12 PM

LG. Do we want a test that checks if the remark is not emitted?

This revision is now accepted and ready to land.Jan 17 2022, 2:12 PM

LG. Do we want a test that checks if the remark is not emitted?

I did a test locally and it resolved the issue, but it's not necessary because I already have a test that doesn't emit a remark if the cold attribute is present in OpenMPOpt's tests.

LG. Do we want a test that checks if the remark is not emitted?

I did a test locally and it resolved the issue, but it's not necessary because I already have a test that doesn't emit a remark if the cold attribute is present in OpenMPOpt's tests.

We don't have check line(s) in the test case?

LG. Do we want a test that checks if the remark is not emitted?

I did a test locally and it resolved the issue, but it's not necessary because I already have a test that doesn't emit a remark if the cold attribute is present in OpenMPOpt's tests.

We don't have check line(s) in the test case?

It's covered by this line which basically tests internalization, which is what emits the remark this hides.

llvm/test/Transforms/OpenMP/single_threaded_execution.ll:; CHECK-NOT: [openmp-opt] Basic block @cold entry is executed by a single thread.
This revision was landed with ongoing or failed builds.Jan 17 2022, 2:29 PM
This revision was automatically updated to reflect the committed changes.