This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Correctly lower llvm.exp.f32
ClosedPublic

Authored by arsenm on Jun 15 2023, 7:13 AM.

Details

Reviewers
rampitec
foad
cdevadas
Pierre-vh
jhuber6
b-sumner
Group Reviewers
Restricted Project
Summary

The library expansion has too many paths for all the permutations of
DAZ, unsafe and the 3 exp functions. It's easier to expand it in the
backend when we know all of these things. The library currently misses
the no-infinity check on the overflow, which this handles optimizing
out.

Some of the <3 x half> fast tests regress due to vector widening
dropping flags which will be fixed separately.

Apparently there is no exp10 intrinsic, but there should be. Adds some
deadish code in preparation for adding one while I'm following along
with the current library expansion.

Diff Detail

Event Timeline

arsenm created this revision.Jun 15 2023, 7:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2023, 7:13 AM
arsenm requested review of this revision.Jun 15 2023, 7:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2023, 7:13 AM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm added inline comments.Jun 15 2023, 1:31 PM
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
3425

This produces worse code than the DAG because we don't have the compare commuting combine. We can get closer matching and better output by pre-commuting this

rampitec accepted this revision.Jul 5 2023, 12:27 PM
This revision is now accepted and ready to land.Jul 5 2023, 12:27 PM
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fexp.mir