-
Notifications
You must be signed in to change notification settings - Fork 12k
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
"Instruction does not dominate all uses" with opt -disable-basicaa -loop-versioning #36998
Comments
Still reproduces with |
Converted the testcase to opaque pointers. Able to reproduce with I want to work on this issue, can I assign this to self? |
The IR ins't in LCSSA form, in the critical edge, store uses inc which is a value defined inside the loop. |
Loop Optimizations expect the input loop to be in LCSSA form. But it seems that LoopVersioning doesn't have any check to see if the loop is actually in LCSSA form. As a result, if we give it a loop which is not in LCSSA form but still correct semantically, the resulting transformation fails to pass through verifier pass with the following error. Instruction does not dominate all uses! %inc = add nsw i16 undef, 1 store i16 %inc, ptr @c, align 1 As the loop is not in LCSSA form, LoopVersioning's transformations leads to invalid IR! As some instructions do not dominate all their uses. This patch checks if a loop is in LCSSA form, if not it will call formLCSSARecursively on the loop before passing it to LoopVersioning. Fixes: llvm#36998
Loop Optimizations expect the input loop to be in LCSSA form. But it seems that LoopVersioning doesn't have any check to see if the loop is actually in LCSSA form. As a result, if we give it a loop which is not in LCSSA form but still correct semantically, the resulting transformation fails to pass through verifier pass with the following error. Instruction does not dominate all uses! %inc = add nsw i16 undef, 1 store i16 %inc, ptr @c, align 1 As the loop is not in LCSSA form, LoopVersioning's transformations leads to invalid IR! As some instructions do not dominate all their uses. This patch checks if a loop is in LCSSA form, if not it will call formLCSSARecursively on the loop before passing it to LoopVersioning. Fixes: llvm#36998
Extended Description
opt -S -o - bbi-14805.ll -disable-basicaa -loop-versioning
gives
Instruction does not dominate all uses!
%inc = add nsw i16 undef, 1
store i16 %inc, i16* @c, align 1
LLVM ERROR: Broken function found, compilation aborted!
Found when running random passes/flags on random input. We don't normally use -disable-basicaa -loop-versioning.
This happens also with some old opt binary built in Nov 2016.
The text was updated successfully, but these errors were encountered: