This is an archive of the discontinued LLVM Phabricator instance.

Add missing atomic libcall support.
ClosedPublic

Authored by jyknight on Jun 30 2015, 11:56 AM.

Details

Summary

Support for emitting libcalls for atomic_fetch_nand and
atomic_{add,sub,and,or,xor,nand}_fetch was missing; add it, and some
test cases.

Diff Detail

Repository
rL LLVM

Event Timeline

jyknight updated this revision to Diff 28805.Jun 30 2015, 11:56 AM
jyknight retitled this revision from to Add missing atomic libcall support..
jyknight updated this object.
jyknight edited the test plan for this revision. (Show Details)
jyknight added a subscriber: Unknown Object (MLST).
majnemer added inline comments.
lib/CodeGen/CGAtomic.cpp
811–815 ↗(On Diff #28805)

Do any of the tests cover this part of the change?

jyknight added inline comments.Jun 30 2015, 1:02 PM
lib/CodeGen/CGAtomic.cpp
811–815 ↗(On Diff #28805)

None of the new ones do, but also note that this part is not a change in behavior, just changing from "default:" to listing all the options not listed above, so that missing a case emits a warning.

These calls are at least mostly covered by other tests, although I did not audit them to ensure 100% coverage.

compnerd accepted this revision.Aug 3 2015, 7:25 PM
compnerd added a reviewer: compnerd.
compnerd added a subscriber: compnerd.
compnerd added inline comments.
lib/CodeGen/CGAtomic.cpp
788 ↗(On Diff #28805)

Can you make this a bit more useful by indicating where it should have been handled (Id assume Sema).

811–815 ↗(On Diff #28805)

There are existing tests for the C11 atomics.

846 ↗(On Diff #28805)

Similar.

This revision is now accepted and ready to land.Aug 3 2015, 7:25 PM
This revision was automatically updated to reflect the committed changes.