This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] bitreverse, sin, cos are safe to speculatively execute
AbandonedPublic

Authored by mareko on Aug 1 2016, 9:47 AM.

Details

Reviewers
arsenm

Diff Detail

Event Timeline

mareko updated this revision to Diff 66336.Aug 1 2016, 9:47 AM
mareko retitled this revision from to [ValueTracking] bitreverse, sin, cos are safe to speculatively execute.
mareko updated this object.
mareko added a reviewer: arsenm.
arsenm edited edge metadata.Aug 1 2016, 11:55 AM

Needs tests. Bitreverse is definitely OK, but I'm not sure about sin/cos. The math function handling is a mess and they might need to be assumed to set errno (although I don't see why this is the case since the libcall can work for targets with this problem)

mareko added a comment.Aug 1 2016, 2:26 PM

I'd also like to mark UDiv, URem, SDiv, SRem, exp2, log2, pow, and at least 14 AMDGPU intrinsics as speculatively-executable.

All of those have no side effects on AMDGPU. Right now, we are losing some performance here.

The divisions can't be speculated because divide by 0 is undefined behavior. The AMDGPU intrinsics and bitreverse are now speculatable

mareko abandoned this revision.May 2 2017, 11:18 AM