This is an archive of the discontinued LLVM Phabricator instance.

[NVPTX] Only lower sin/cos to approximate instructions if unsafe math is allowed.
ClosedPublic

Authored by tra on Jan 12 2017, 11:23 AM.

Details

Summary

Previously we'd always lower @llvm.{sin,cos}.f32 to {sin.cos}.approx.f32 instruction even when unsafe FP math was not allowed.

Clang-generated IR is not affected by this change as it uses precise sin/cos from CUDA's libdevice when unsafe math is disabled.

Event Timeline

tra updated this revision to Diff 84150.Jan 12 2017, 11:23 AM
tra retitled this revision from to [NVPTX] Only lower sin/cos to approximate instructions if unsafe math is allowed..
tra updated this object.
tra added reviewers: jlebar, jholewinski.
tra added a subscriber: llvm-commits.
jlebar accepted this revision.Jan 12 2017, 8:54 PM
jlebar edited edge metadata.

Looks great.

Perhaps we should merge the two foo-no-fast-math.ll files into one? I have another few testcases I want to add very shortly.

This revision is now accepted and ready to land.Jan 12 2017, 8:54 PM

Perhaps we should merge the two foo-no-fast-math.ll files into one? I have another few testcases I want to add very shortly.

Oh, right, you're crashing llc, so it has to be in a separate file. Carry on!

This revision was automatically updated to reflect the committed changes.