This is an archive of the discontinued LLVM Phabricator instance.

[os_log] Mark os_log_helper `nounwind`
ClosedPublic

Authored by vsk on Apr 1 2019, 6:43 PM.

Details

Summary

Allow the optimizer to remove unnecessary EH cleanups surrounding calls
to os_log_helper, to save some code size.

As a follow-up, it might be worthwhile to add a BasicNoexcept exception
spec to os_log_helper, and to then teach CGCall to emit direct calls for
callees which can't throw. This could save some compile-time.

Diff Detail

Event Timeline

vsk created this revision.Apr 1 2019, 6:43 PM
This revision is now accepted and ready to land.Apr 2 2019, 10:29 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2019, 10:41 AM
ahatanak added inline comments.May 29 2020, 5:54 PM
test/CodeGenObjCXX/os_log.mm
3 ↗(On Diff #193322)

Sorry for the late feedback.

Can we pass -O0 instead of -O1 to avoid running the optimization passes and just check that the helper function has attribute nounwind? I haven't checked, but I suspect there are already tests in llvm that check SimplifyCFG turns nounwind invokes to calls.

I'm cleaning up this file and os_log.m in preparation for adding more test cases.

vsk marked an inline comment as done.Jun 1 2020, 5:00 PM
vsk added inline comments.
test/CodeGenObjCXX/os_log.mm
3 ↗(On Diff #193322)