This is an archive of the discontinued LLVM Phabricator instance.

[Clang,Driver] Default to Darwin_libsystem_m veclib on iOS based targets.
AbandonedPublic

Authored by fhahn on May 14 2021, 6:27 AM.

Details

Summary

Building on D102489, default to Darwin_libsystem_m veclib on iOS based
targets.

Diff Detail

Event Timeline

fhahn requested review of this revision.May 14 2021, 6:27 AM
fhahn created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMay 14 2021, 6:27 AM
arphaman added inline comments.May 14 2021, 7:33 AM
clang/lib/Driver/ToolChains/Darwin.cpp
2492

Is this applicable to the watchOS targets as well? The iOS based check doesn't cover it.

clang/test/Driver/darwin-veclib-default.c
9

darwinos isn't a valid OS type, what's your intent with this testcase here?

fhahn added inline comments.May 14 2021, 8:37 AM
clang/lib/Driver/ToolChains/Darwin.cpp
2492

libsystem_m's vector functions should be available on all Darwin platforms I think. I'd gradually opt-in additional platforms, once we verified it is clearly beneficial for each platform individually.

Should I add a TODO?

clang/test/Driver/darwin-veclib-default.c
9

Ah OK! Would it make sense to check -darwin? Or just -iOS?

scanon added inline comments.May 14 2021, 9:58 AM
clang/lib/Driver/ToolChains/Darwin.cpp
2492

Correct, available on all Darwin systems. These APIs were introduced in macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, and driverkit 19.0. I think we need a check that the target is at least those versions somewhere?

arphaman added inline comments.May 14 2021, 11:01 AM
clang/lib/Driver/ToolChains/Darwin.cpp
2492

Yes we should check if the target version is supported in the Driver and error out if it's used for an earlier OS.

2492

Sure, a FIXME comment for the other platform support is fine for now.

clang/test/Driver/darwin-veclib-default.c
9

Just ios. You're already checking darwin above.

fhahn planned changes to this revision.May 21 2021, 9:35 AM

We are still evaluating whether it is safe to use this as default. I'll mark it as 'changes planned' for now.

fhahn abandoned this revision.Sep 13 2022, 2:17 AM

As of now, I don't think this is safe to do with the precision guarantees Darwin_libsystem_m provides unfortunately.

Herald added a project: Restricted Project. · View Herald TranscriptSep 13 2022, 2:17 AM
Herald added a subscriber: MaskRay. · View Herald Transcript