Skip to content

[benchmark] Delete two benchmarks and add generic floating-point conversion lit tests #33853

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

Merged
merged 1 commit into from
Sep 9, 2020

Conversation

xwu
Copy link
Collaborator

@xwu xwu commented Sep 8, 2020

This PR follows up on #33801 and #33839 by removing benchmarks that are unnecessary now that lit tests check that the optimization is, well, optimal for generic Double-to-Double conversion.

In addition, I have added two additional checks to floating_point_conversion.swift to ensure that generic Double-to-Float and Float-to-Double conversions are also optimized as expected.

@xwu

This comment has been minimized.

@xwu

This comment has been minimized.

@xwu
Copy link
Collaborator Author

xwu commented Sep 8, 2020

@swift-ci test macOS platform

@xwu
Copy link
Collaborator Author

xwu commented Sep 8, 2020

@swift-ci test Linux platform

@xwu xwu requested a review from eeckstein September 9, 2020 00:08
@xwu xwu marked this pull request as ready for review September 9, 2020 00:12
@xwu
Copy link
Collaborator Author

xwu commented Sep 9, 2020

@eeckstein First time writing a SIL optimizer test for me; just want to make sure all's kosher here.

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!


// CHECK-LABEL: sil @$s4test0A13DoubleToFloatySfSdF
// CHECK: bb0(%0 : $Double):
// CHECK: struct_extract %0 : $Double, #Double._value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usual way to check this is to use patterns for the values, e.g.

[[ARG:%[0-9]+]] = struct_extract %0
[[CONV:%[0-9]+]] = builtin "fptrunc_FPIEEE64_FPIEEE32"([[ARG]])
...

But doing it with CHECK-NEXT is perfectly fine for this test.

@xwu xwu merged commit 324ba39 into swiftlang:master Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants