This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix to guard fetch and cas 64-bit builtin versions
ClosedPublic

Authored by kamaub on Sep 30 2021, 6:27 AM.

Details

Summary

The builtins: __compare_and_swaplp, __fetch_and_addlp,
__fetch_and_andlp, __fetch_and_orlp, __fetch_and_swaplp are
64 bit only. This patch ensures the compiler produces an error in 32 bit mode.

Event Timeline

kamaub created this revision.Sep 30 2021, 6:27 AM
kamaub requested review of this revision.Sep 30 2021, 6:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2021, 6:27 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
kamaub updated this revision to Diff 376312.Sep 30 2021, 11:55 AM

Rebasing patch to get past intermittent test-suite failure

nemanjai accepted this revision.Sep 30 2021, 5:30 PM

LGTM with the test nit addressed.

clang/test/CodeGen/builtins-ppc-xlcompat-fetch-cas-64bit-only-error.c
1

I imagine there must be an existing test case handling the other 64-bit only builtins that you can add this to.

This revision is now accepted and ready to land.Sep 30 2021, 5:30 PM
kamaub updated this revision to Diff 376962.Oct 4 2021, 11:32 AM

Moving test case to correct file before commiting as request in review comment.

kamaub marked an inline comment as done.Oct 5 2021, 6:29 AM