Remove unnecessary idiom recognition assertions - #17949
Conversation
hzongaro
left a comment
There was a problem hiding this comment.
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. |
|
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