-
Notifications
You must be signed in to change notification settings - Fork 13.4k
apparent infinite loop in InstCombine #59897
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
Comments
Reduced for
|
Gets transformed into this first:
Then into:
Then into:
And then:
And then we're back where we started:
|
Without having looked into this too closely, might be related to 21d3871 by @rotateright? |
Yes, or at least that exposed some other missing/flawed fold. I had a feeling we'd see more inf-loops than only the ones I found before applying that patch. Taking a look now. |
https://alive2.llvm.org/ce/z/ZXCtgi This breaks the infinite combine loop for issue #59897, but we may still need more changes to avoid those loops.
The inf-loop for this example should be fixed now, but the more general problem is in InstCombinerImpl::transformZExtICmp(). It can create 3 instructions from 2 as shown in the IR sequence above, so we need to limit it. |
We're avoiding the inf-loop in this example 2 different ways now, so I think it's safe to close. |
apologies for the unreduced module but it's not easy to make minimal triggers for this kind of bug. the function below, optimized at -O2, appears to hang us up indefinitely. all of the cases triggering this have contained a bitreverse intrinsic so I suspect that's part of the problem.
I attached a profiler to the process and here's what's up at the top:
trigger this by running
opt -O2
on this code:The text was updated successfully, but these errors were encountered: