-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Fill in some missing C23 math libcall handling #170672
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
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2cc5630
[InstSimplify] Add roundeven constant-propagation tests
valadaptive 416811a
[InferAttrs] Mark ceil and round as memory(none)
valadaptive a50096b
[TLI] Handle roundeven libcall in hasOptimizedCodegen
valadaptive 28589a3
[SelectionDAG] Handle roundeven libcall in visitCall
valadaptive 2536928
[InferAttrs] Handle roundeven like other libm functions
valadaptive d0d4689
[ConstantFolding] Handle roundeven libcalls
valadaptive 09cae4b
[NumericalStabilitySanitizer] Handle roundeven libcalls
valadaptive 3fb29b7
[InstCombine] Add regression tests for f[min][max]imum_num libcalls
valadaptive 95677da
[TLI] Handle f[min/max]imum_num in hasOptimizedCodegen
valadaptive e0a160b
[InferAttrs] Handle f[min/max]imum_num like other libm functions
valadaptive 3696d62
[ValueTracking] Handle f[min/max]imum_num in getIntrinsicForCallSite
valadaptive 11e899c
[SimplifyLibCalls] Recognize and simplify f[min/max]imumnum
valadaptive f055c83
[NumericalStabilitySanitizer] Handle f[min/max]imum_num libcalls
valadaptive File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -304,13 +304,13 @@ declare float @cbrtf(float) | |
| ; CHECK: declare x86_fp80 @cbrtl(x86_fp80) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare x86_fp80 @cbrtl(x86_fp80) | ||
|
|
||
| ; CHECK: declare double @ceil(double) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| ; CHECK: declare double @ceil(double) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is something to be fixed in a future PR and not here, but these CHECK lines don't appear to do anything. I'm not sure why, but this test always seems to pass regardless of what the actual function attributes are. |
||
| declare double @ceil(double) | ||
|
|
||
| ; CHECK: declare float @ceilf(float) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| ; CHECK: declare float @ceilf(float) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare float @ceilf(float) | ||
|
|
||
| ; CHECK: declare x86_fp80 @ceill(x86_fp80) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| ; CHECK: declare x86_fp80 @ceill(x86_fp80) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare x86_fp80 @ceill(x86_fp80) | ||
|
|
||
| ; The second argument of int chmod(FILE*, mode_t) is a 32-bit int on most | ||
|
|
@@ -473,6 +473,24 @@ declare float @fminf(float, float) | |
| ; CHECK: declare x86_fp80 @fminl(x86_fp80, x86_fp80) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare x86_fp80 @fminl(x86_fp80, x86_fp80) | ||
|
|
||
| ; CHECK: declare double @fmaximum_num(double, double) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare double @fmaximum_num(double, double) | ||
|
|
||
| ; CHECK: declare float @fmaximum_numf(float, float) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare float @fmaximum_numf(float, float) | ||
|
|
||
| ; CHECK: declare x86_fp80 @fmaximum_numl(x86_fp80, x86_fp80) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare x86_fp80 @fmaximum_numl(x86_fp80, x86_fp80) | ||
|
|
||
| ; CHECK: declare double @fminimum_num(double, double) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare double @fminimum_num(double, double) | ||
|
|
||
| ; CHECK: declare float @fminimum_numf(float, float) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare float @fminimum_numf(float, float) | ||
|
|
||
| ; CHECK: declare x86_fp80 @fminimum_numl(x86_fp80, x86_fp80) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare x86_fp80 @fminimum_numl(x86_fp80, x86_fp80) | ||
|
|
||
| ; CHECK: declare double @fmod(double, double) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare double @fmod(double, double) | ||
|
|
||
|
|
@@ -909,15 +927,24 @@ declare x86_fp80 @rintl(x86_fp80) | |
| ; CHECK: declare noundef i32 @rmdir(ptr noundef readonly captures(none)) [[NOFREE_NOUNWIND]] | ||
| declare i32 @rmdir(ptr) | ||
|
|
||
| ; CHECK: declare double @round(double) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| ; CHECK: declare double @round(double) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare double @round(double) | ||
|
|
||
| ; CHECK: declare float @roundf(float) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| ; CHECK: declare float @roundf(float) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare float @roundf(float) | ||
|
|
||
| ; CHECK: declare x86_fp80 @roundl(x86_fp80) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| ; CHECK: declare x86_fp80 @roundl(x86_fp80) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare x86_fp80 @roundl(x86_fp80) | ||
|
|
||
| ; CHECK: declare double @roundeven(double) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare double @roundeven(double) | ||
|
|
||
| ; CHECK: declare float @roundevenf(float) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare float @roundevenf(float) | ||
|
|
||
| ; CHECK: declare x86_fp80 @roundevenl(x86_fp80) [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare x86_fp80 @roundevenl(x86_fp80) | ||
|
|
||
| ; CHECK: declare double @scalbln(double, i64) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] | ||
| declare double @scalbln(double, i64) | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It's a bit sad that adding full support for a new libcall requires adding it to a manually-maintained list of functions starting with the letter R.