This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Use rcp for fdiv 1, x with fpmath metadata
ClosedPublic

Authored by arsenm on Jul 26 2016, 10:42 AM.

Details

Summary

Using rcp should be OK for safe math usually, so this
should not be replacing the original fdiv.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 65552.Jul 26 2016, 10:42 AM
arsenm retitled this revision from to AMDGPU: Use rcp for fdiv 1, x with fpmath metadata.
arsenm updated this object.
arsenm added reviewers: tstellarAMD, mareko.
arsenm added a subscriber: llvm-commits.
mareko edited edge metadata.Jul 26 2016, 1:20 PM

LGTM.

BTW, while this fixes the regression, doing x*(1/y) in Mesa generates slightly better code.

LGTM.

BTW, while this fixes the regression, doing x*(1/y) in Mesa generates slightly better code.

arsenm accepted this revision.Jul 26 2016, 4:33 PM
arsenm added a reviewer: arsenm.

r276823

This revision is now accepted and ready to land.Jul 26 2016, 4:33 PM
arsenm closed this revision.Jul 26 2016, 4:34 PM
test/CodeGen/AMDGPU/rcp-pattern.ll