Page MenuHomePhabricator

[TargetLibraryInfo] add mappings from LLVM sin/cos intrinsics to SVML calls

Authored by spatel on May 31 2018, 3:56 PM.



I'm assuming these were accidentally left out of D19544.
D40044 made it more likely that we'll have LLVM math intrinsics rather than libcalls, so this bug was more easily exposed.
As the tests/code show, we already have the complete mappings for pow/exp/log.

I don't have any experience with SVML, so I don't know if anything else is missing. It's also not clear to me that we should be doing this transform in IR rather than DAG/isel, but that's a separate issue.

Diff Detail


Event Timeline

spatel created this revision.May 31 2018, 3:56 PM

Makes sense to me, I'm not a SVML expert but we're already doing the same for exp/exp, log/logf and pow/powf.

Any comments @craig.topper et al?

This change looks good to me. Thanks for the patch.

spatel accepted this revision.Jun 7 2018, 11:23 AM

Marking this as accepted here in phab ahead of commit, so we don't get the warning about unknown state.

This revision is now accepted and ready to land.Jun 7 2018, 11:23 AM
This revision was automatically updated to reflect the committed changes.