Page MenuHomePhabricator

[CGAtomic] Mark atomic libcall functions `nounwind`
ClosedPublic

Authored by guiand on Aug 7 2020, 5:10 PM.

Details

Summary
These functions won't ever unwind. This is useful for MemorySanitizer
as it simplifies handling __atomic_load in particular.

Diff Detail

Event Timeline

guiand created this revision.Aug 7 2020, 5:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2020, 5:10 PM
guiand requested review of this revision.Aug 7 2020, 5:10 PM

While we are here, how about setting a few more attributes?
argmemonly, readonly/writeonly, willreturn come to mind.

nocapture on the pointer argument

I don't think we can necessarily guarantee argmemonly/readonly/writeonly, particularly since these library calls can take a lock somewhere inside. I'll definitely add nocapture and willreturn though.

guiand updated this revision to Diff 284922.Aug 11 2020, 3:42 PM

Added willreturn. I think nocapture is probably best left to a future change since it's more invasive -- it would require keeping tabs of which arguments to each function is a pointer arg.

eugenis accepted this revision.Aug 13 2020, 3:49 PM

LGTM

This revision is now accepted and ready to land.Aug 13 2020, 3:49 PM
This revision was automatically updated to reflect the committed changes.