This is an archive of the discontinued LLVM Phabricator instance.

[x86] set default reciprocal (division and square root) codegen to match GCC
ClosedPublic

Authored by spatel on Jun 11 2015, 9:41 AM.

Details

Summary

D8982 ( checked in at http://reviews.llvm.org/rL239001 ) added command-line options to specify reciprocal estimate codegen.

This patch changes the default settings for x86 targets to allow recip codegen (except for scalar division because that breaks too much code) when using -ffast-math or its equivalent. This will match GCC behavior for this kind of codegen.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel updated this revision to Diff 27519.Jun 11 2015, 9:41 AM
spatel retitled this revision from to [x86] set default reciprocal (division and square root) codegen to match GCC.
spatel updated this object.
spatel edited the test plan for this revision. (Show Details)
spatel added reviewers: hfinkel, ahatanak, nadav, andreadb.
spatel added a subscriber: Unknown Object (MLST).
ahatanak edited edge metadata.Jun 19 2015, 6:42 PM

I just want to make sure I understand where this is headed. The recip flag and refinement step are eventually going to be added to the IR fast-math flags and propagated to the DAG nodes, is that correct?

I just want to make sure I understand where this is headed. The recip flag and refinement step are eventually going to be added to the IR fast-math flags and propagated to the DAG nodes, is that correct?

That's correct, assuming there are no showstoppers for FMF in the DAG. The alternative would be to add a function attribute for this. Without one of those solutions, it's my understanding that we can't specify recip codegen when using LTO.

ahatanak accepted this revision.Jun 19 2015, 11:20 PM
ahatanak edited edge metadata.

OK, thanks. This looks fine to me.

This revision is now accepted and ready to land.Jun 19 2015, 11:20 PM
This revision was automatically updated to reflect the committed changes.