This is an archive of the discontinued LLVM Phabricator instance.

Cold attribute on function decls are lost. Fix the problem
ClosedPublic

Authored by davidxl on Jun 12 2017, 7:23 PM.

Details

Summary

LLVM static branch prediction depends on cold attribute to annotate branch probability. This is currently not possible for cold function decls as the information is dropped by FE.

This patch attaches the attributes to the callsite as noReturn. Another way is to pass the attribute to the function decl.

Also need suggestions on how to add a clang test case.

Diff Detail

Repository
rL LLVM

Event Timeline

davidxl created this revision.Jun 12 2017, 7:23 PM
davidxl updated this revision to Diff 102358.Jun 13 2017, 9:47 AM

Add a test case.

rsmith accepted this revision.Jun 13 2017, 2:03 PM

LGTM

This revision is now accepted and ready to land.Jun 13 2017, 2:03 PM
This revision was automatically updated to reflect the committed changes.