-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Go back to using static inline stubs for sqrt and remainder #6769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…now that SR-2089 is resolved.
@swift-ci Please test. |
Can you add a test that shows the constant-folding does happen under -O? |
@jrose-apple yes, but it'll need to wait until I'm on a machine where I can actually build and run tests =) I'll take a look at it tomorrow. |
@moiseev very straightforward, but please sanity-check. |
|
||
public func test6( ) -> Double { | ||
return sqrt(4) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess since we're worried about LLVM's sqrt, is it worth adding a test for sqrt(-1)
not becoming undef
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the earlier CHECK-NOT llvm.sqrt probably covers us, but I can definitely add one.
@swift-ci Please test. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
I originally planned to have these be static inline, but had to back that out due to SR-2089. That's resolved now though, so this should work, and allow constant folding through square root and remainder.
rdar://problem/30004033