-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[NewGVN] Assertion `BeforeCC->isEquivalentTo(AfterCC) && "Value number changed after main loop completed!"' failed #63335
Comments
related to https://reviews.llvm.org/D130910, simplified case: https://gcc.godbolt.org/z/hdT1d18zY |
This crash is due to the caching for OpIsSafeForPhiOfOps being unsound. It uses information thats valid for a given block but may not be true for blocks processed after. Detailed analysis for the reduced test case: While processing instructions
When verifying if a maximal fixpoint was reached:
Here is another example to show that this is not specific to safety of memory accesses https://gcc.godbolt.org/z/Kvxr6oWba. I'm thinking we can either refine the caching to have the phi block as part of it or drop it completely. |
The caching mechanism for 'OpIsSafeForPhiOfOps' is unsound. An operand is deemed unsafe for PhiOfOps if it depends on a phi that resides in the same block as the Phi block, i.e., where we are performing the PhiOfOps. This is to avoid having to materialize the translated subexpressions. To avoid redundant code walking, a cache is used to store these results. Note, however, that since the safety is specific to the Phi block, we cannot, in general, use the cached results for other blocks. This patch addresses this by having a cache per block instead of a single one for the entire function. closes llvm#63335
It appears to be a recent regression.
Compiler Explorer: https://godbolt.org/z/M87jMoKT1
The text was updated successfully, but these errors were encountered: