This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: mark ldexp LibCalls as unavailable
ClosedPublic

Authored by nhaehnle on Nov 25 2015, 9:24 AM.

Details

Summary

The LibCallSimplifier will turn llvm.exp2.* intrinsics into ldexp* libcalls
which do not make sense with the AMDGPU backend.

In the long run, we'll want an llvm.ldexp.* intrinsic to properly make use of
this optimization, but this works around the problem for now.

See also: http://reviews.llvm.org/D14327 (suggested llvm.ldexp.* implementation)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92709

Diff Detail

Repository
rL LLVM

Event Timeline

nhaehnle updated this revision to Diff 41155.Nov 25 2015, 9:24 AM
nhaehnle retitled this revision from to AMDGPU: mark ldexp LibCalls as unavailable.
nhaehnle updated this object.
nhaehnle added reviewers: arsenm, tstellarAMD.
test/Transforms/InstCombine/exp2-1.ll
84–89 ↗(On Diff #41155)

I'm confused about this test. amdgcn does not support ldexp, so why is it being checked here?

arsenm added inline comments.Nov 30 2015, 4:02 PM
test/Transforms/InstCombine/exp2-1.ll
5 ↗(On Diff #41155)

the -mcpu is unnecessary

nhaehnle updated this revision to Diff 41606.Dec 2 2015, 3:22 AM

Fix test: remove unneeded -mcpu; also, win and amdgpu behave differently

tstellarAMD added inline comments.Dec 2 2015, 6:32 AM
test/Transforms/InstCombine/exp2-1.ll
84–86 ↗(On Diff #41606)

If you add an additional -check-prefix=CHECK option to all of the RUN lines, then these can be consolidated into a single CHECK-LABEL: line. In fact I think CHECK is a default prefix, so you may not even have to add the extra -check-prefix to consolidate these.

96–98 ↗(On Diff #41606)

These can be consolidated too.

arsenm added inline comments.Dec 2 2015, 6:56 AM
test/Transforms/InstCombine/exp2-1.ll
84–86 ↗(On Diff #41606)

the added CHECK is needed. It's only implicitly there if no other check prefix is specified

nhaehnle updated this revision to Diff 41635.Dec 2 2015, 8:40 AM

Consolidate test labels

I left the first batch of tests (where the input uses libcalls) untouched.
The win32 run actually doesn't apply the transformation for those, so
things would have gotten rather messy.

tstellarAMD accepted this revision.Dec 2 2015, 8:48 AM
tstellarAMD edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Dec 2 2015, 8:48 AM

I don't have commit access, could you push this out?

This revision was automatically updated to reflect the committed changes.