Page MenuHomePhabricator

AMDGPU: mark {exp,log}10{,f,l} library functions as unavailable
ClosedPublic

Authored by nhaehnle on Jun 13 2016, 2:06 AM.

Details

Summary

The SimplifyLibCalls part of InstCombine generates calls to those otherwise.

I wonder if at some point we shouldn't just call disableAllFunctions() and
then enable functions on a whitelist basis...

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96495

Diff Detail

Repository
rL LLVM

Event Timeline

nhaehnle updated this revision to Diff 60496.Jun 13 2016, 2:06 AM
nhaehnle retitled this revision from to AMDGPU: mark {exp,log}10{,f,l} library functions as unavailable.
nhaehnle updated this object.
nhaehnle added reviewers: arsenm, tstellarAMD.
nhaehnle added a subscriber: llvm-commits.
tstellarAMD accepted this revision.Jun 13 2016, 8:24 PM
tstellarAMD edited edge metadata.

The whitelist idea sounds good, what is the advantage of a LibFunc being 'available' ?

This revision is now accepted and ready to land.Jun 13 2016, 8:24 PM

I think it's mostly used by SimplifyLibCalls and perhaps other parts of InstCombine to decide whether certain transformations are allowed.

Interestingly, NVPTX sets disableAllFunctions, but there is a comment saying that "having no standard library prevents e.g. many fastmath optimizations". And indeed, on my shader-db using disableAllFunctions() makes a difference. It might be limited to sqrt and abs functions.

I'll commit this change as-is for now, i.e. stick with blacklisting.

This revision was automatically updated to reflect the committed changes.