This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Custom lower v2f16 fneg/fabs with illegal f16
ClosedPublic

Authored by arsenm on Jun 5 2018, 7:23 AM.

Details

Summary

Fixes terrible code on targets without f16 support. The
legalization creates a mess that is difficult to recover
from. Also should avoid randomly breaking these tests
multiple times in sequence in future commits.

Some regressions in cases where it happens to be better
to pull the source modifier after the conversion.

Diff Detail

Event Timeline

arsenm created this revision.Jun 5 2018, 7:23 AM
rampitec added inline comments.Jun 5 2018, 9:11 AM
test/CodeGen/AMDGPU/fabs.f16.ll
107

Are there a lot of regressions like this?
Any plans to address these?

arsenm added inline comments.Jun 5 2018, 10:27 AM
test/CodeGen/AMDGPU/fabs.f16.ll
107

I don't think so. I only really noticed this one because of the kind of perverse case of using the original and negated value resulting in doubling the number of conversions. We probably have to repeat the performFNeg/Fabs combines for the bit patterns used for lowered f16

This revision is now accepted and ready to land.Jun 5 2018, 10:34 AM
arsenm closed this revision.Jun 6 2018, 2:32 PM

r334132