-
Notifications
You must be signed in to change notification settings - Fork 721
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
Remove unnecessary idiom recognition assertions #17949
Remove unnecessary idiom recognition assertions #17949
Conversation
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 your change looks good - just one minor question/comment.
I notice there are at least four other places in Idiom Recognition that have a TR_ASSERT
that says "not implemented yet". As the goal in the short-term is to get PROD_WITH_ASSUMES working for sanity.functional
test runs, fixing just this one is fine for now, but may I ask you to open a follow up issue to track cleaning up the remaining four - assuming that they also describe situations that can be safely ignored?
I'll generalize this PR at least a bit |
There are uses of TR_ASSERT() in idiom recognition that check for cases that are not necessarily impossible and that are handled conservatively in builds where TR_ASSERT() is not checked. Assertions are not a good way to detect and report these cases, since assertion failure is not likely to be due to a bug. This commit removes a number of these assertions. Now the conservative logic will apply in all builds. When it does, a static debug counter will be incremented, and (when tracing idiom recognition) a message will be printed to the log. Anyone who wants to look for transformations that have been prevented due to incomplete support for a particular case can use the new static debug counters. Additionally, use dumpOptDetails() to trace when a transformer fails. In that case it's misleading to leave the log showing only the message from performTransformation().
17cd1a1
to
6ef55f5
Compare
Updated. Along with some assertions in the transformations, I caught |
I think I miscounted - the third was in Thanks for catching the additional changes in the transformations! I'll review your changes. |
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.
Looks good. Thanks!
Jenkins test sanity all jdk11,jdk17 |
Jenkins test sanity zlinux jdk11 |
Jenkins test sanity jdk17 aarch64_linux |
Jenkins test sanity aarch64_linux jdk17 |
Jenkins test sanity zlinux jdk11 |
1 similar comment
Jenkins test sanity zlinux jdk11 |
Jenkins test sanity aarch64_linux jdk17 |
Jenkins test sanity zlinux jdk11 |
1 similar comment
Jenkins test sanity zlinux jdk11 |
Jenkins test sanity zlinux jdk11 |
Jenkins test sanity zlinux jdk11 |
Jenkins test sanity aarch64_linux jdk17 |
There are uses of
TR_ASSERT()
in idiom recognition that check for cases that are not necessarily impossible and that are handled conservatively in builds whereTR_ASSERT()
is not checked. Assertions are not a good way to detect and report these cases, since assertion failure is not likely to be due to a bug.This commit removes a number of these assertions. Now the conservative logic will apply in all builds. When it does, a static debug counter will be incremented, and (when tracing idiom recognition) a message will be printed to the log.
Anyone who wants to look for transformations that have been prevented due to incomplete support for a particular case can use the new static debug counters.
Additionally, use
dumpOptDetails()
to trace when a transformer fails. In that case it's misleading to leave the log showing only the message fromperformTransformation()
.Fixes #17819