This is an archive of the discontinued LLVM Phabricator instance.

[Clang,Driver] Add -fveclib=Darwin_libsystem_m support.
ClosedPublic

Authored by fhahn on May 14 2021, 5:30 AM.

Details

Summary

Support for Darwin's libsystem_m's vector functions has been added to
LLVM in 93a9a8a8d90f.

This patch adds support for -fveclib=Darwin_libsystem_m to Clang.

Diff Detail

Event Timeline

fhahn created this revision.May 14 2021, 5:30 AM
fhahn requested review of this revision.May 14 2021, 5:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 14 2021, 5:30 AM
arphaman added inline comments.May 14 2021, 7:29 AM
clang/lib/CodeGen/BackendUtil.cpp
405

Can you add an IRGen testcase that verifies that TLII is setting the vecLib correctly here?

fhahn added inline comments.May 14 2021, 7:33 AM
clang/lib/CodeGen/BackendUtil.cpp
405

Like a test that generates IR using a vector function from Darwin's libsystem m?

arphaman added inline comments.May 14 2021, 7:34 AM
clang/lib/CodeGen/BackendUtil.cpp
405

Sure, I think that should cover this switch case.

fhahn updated this revision to Diff 345449.May 14 2021, 8:32 AM

Add end-to-end test, as suggested. Thanks!

fhahn added inline comments.May 14 2021, 8:38 AM
clang/lib/CodeGen/BackendUtil.cpp
405

I added clang/test/CodeGen/veclib-darwin-libsystem-m.c which should contain an end-to-end test.

arphaman accepted this revision.May 14 2021, 8:52 AM
This revision is now accepted and ready to land.May 14 2021, 8:52 AM
This revision was automatically updated to reflect the committed changes.
dyung added a subscriber: dyung.May 14 2021, 10:42 PM

The test added in this commit was failing on the PS4 bot (https://lab.llvm.org/buildbot/#/builders/139/builds/4059). I've reverted the change in 59b419adc6e608db8d7c31efcc37f34c0b57b7d0 to get the bot green again.

thakis added a subscriber: thakis.May 15 2021, 4:07 AM

(Failed on our bots too -- the new test probably just needs a REQUIRES: aarch64-registered-target)

The test added in this commit was failing on the PS4 bot (https://lab.llvm.org/buildbot/#/builders/139/builds/4059). I've reverted the change in 59b419adc6e608db8d7c31efcc37f34c0b57b7d0 to get the bot green again.

(Failed on our bots too -- the new test probably just needs a REQUIRES: aarch64-registered-target)

Thanks! I re-landed the change in 803c52d0dba9 with REQUIRES: aarch64-registered-target