See D24815 for the clang side of this that turns command-line flags into a function attribute string.
The motivation for the change is that we can't have pseudo-global settings for codegen living in TargetOptions because that doesn't work with LTO.
Ideally, these reciprocal attributes will be moved to the instruction-level via FMF, metadata, or something else. But making them function attributes is at least an improvement over the current mess.
The ingredients of this patch are:
- Remove the reciprocal estimate command-line debug option.
- Add TargetRecip to TargetLowering.
- Remove TargetRecip from TargetOptions.
- Clean up the TargetRecip implementation to work with this new scheme.
- Set the default reciprocal settings in TargetLoweringBase (everything is off).
- Update the PowerPC defaults, users, and tests.
- Update the x86 defaults, users, and tests.
Seems reasonable - otherwise possible to keep it local in the various routines that want to know about the estimates? Parse there rather than initialize at the beginning? That way the function above that builds up the struct can be the whole interface rather than caching. That said, not sure how often it's called.