-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
[VPlan] Assertion `VF.Width == Width && "VPlan cost model and legacy cost model disagreed"' failed. #99701
Comments
I'm seeing this as well with a multitude of hits with csmith. One reduced test case: clang -O3 -march=z16 crash0.i -o a.out -w -mllvm -disable-licm-promotion -mllvm -force-target-instruction-cost=1 -mllvm -unroll-count=4 |
Thanks @patrick-rivos, it looks like all test cases had dead instructions, which would be considered by the legacy cost model but not the VPlan-based one (because VPlan-based DCE would clean them up before). Should be fixed now. @JonPsson1's case was a different issue and should also be fixed. |
Summary: Update collectValuesToIgnore to also ignore dead instructions in the loop. Such instructions will be removed by VPlan-based DCE and won't be considered by the VPlan-based cost model. This closes a gap between the legacy and VPlan-based cost model. In practice with the default pipelines, there shouldn't be any dead instructions in loops reaching LoopVectorize, but it is easy to generate such cases by hand or automatically via fuzzers. Fixes #99701. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250593
Update collectValuesToIgnore to also ignore dead instructions in the loop. Such instructions will be removed by VPlan-based DCE and won't be considered by the VPlan-based cost model. This closes a gap between the legacy and VPlan-based cost model. In practice with the default pipelines, there shouldn't be any dead instructions in loops reaching LoopVectorize, but it is easy to generate such cases by hand or automatically via fuzzers. Fixes llvm#99701.
I have a few finds by the fuzzer that affect LLVM (tested using a1d77ca).
I think they're all duplicates but I'm attaching them all in a .zip so it can be confirmed.
Testcase:
Command/backtrace:
Godbolt: https://godbolt.org/z/a7KPnMh94
Zip with all finds reduced:
finds.zip
Related: #92555 @fhahn
Found via fuzzer.
The text was updated successfully, but these errors were encountered: