This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] SemaChecking for darn family of builtins
ClosedPublic

Authored by Conanap on Sep 22 2021, 12:39 PM.

Details

Summary

The __darn family of builtins are only available on Pwr9,
and only __darn_32 is available on both 64 and 32 bit, while the rest
are only available on 64 bit. The patch adds sema checking
for these builtins and separate the __darn_32's 32 bit
test cases.

Diff Detail

Event Timeline

Conanap created this revision.Sep 22 2021, 12:39 PM
Conanap requested review of this revision.Sep 22 2021, 12:39 PM
Conanap updated this revision to Diff 374329.

Added error testing

lei accepted this revision as: lei.Sep 23 2021, 6:34 AM
lei added a subscriber: lei.

LGTM.
Pleases address the test issue on commit.

clang/test/CodeGen/builtins-ppc-xlcompat-darn-32.c
13 ↗(On Diff #374329)

Isn't this valid for both 32 and 64bit?
Maybe change one of the run lines above to a 64bit test.

This revision is now accepted and ready to land.Sep 23 2021, 6:34 AM
Conanap added inline comments.Sep 23 2021, 7:24 AM
clang/test/CodeGen/builtins-ppc-xlcompat-darn-32.c
13 ↗(On Diff #374329)

It is indeed valid for both 32 bit and 64 bit; there is already a runline for 64 bit in the clang/test/CodeGen/builtins-ppc-xlcompat-darn.c test case (which includes __darn_32, which is why I didn't include it here.

amyk added a subscriber: amyk.Sep 23 2021, 7:25 AM
amyk added inline comments.
clang/test/CodeGen/builtins-ppc-xlcompat-darn-32.c
13 ↗(On Diff #374329)

I agree. I thought __darn_32 is both 32-bit and 64-bit.

amyk added inline comments.Sep 23 2021, 7:26 AM
clang/test/CodeGen/builtins-ppc-xlcompat-darn-32.c
13 ↗(On Diff #374329)

You removed __darn_32 from that file, so maybe we should add it back. And also, adjust the description of the patch to say that __darn_32 is available for 32 and 64-bit.

Conanap updated this revision to Diff 374565.Sep 23 2021, 8:21 AM

Moved test case back to original file and use #ifdef __PPC64__ instead

Conanap edited the summary of this revision. (Show Details)Sep 23 2021, 8:26 AM
amyk accepted this revision as: amyk.Sep 23 2021, 8:29 AM

Thanks for updating the tests and description, Albion.

This revision was landed with ongoing or failed builds.Sep 23 2021, 9:39 PM
This revision was automatically updated to reflect the committed changes.