| Issue |
183739
|
| Summary |
opt: [...] LoopVectorize.cpp:7335: [...] Assertion `[...] " VPlan cost model and legacy cost model disagreed"' failed.
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
mikaelholmen
|
llvm commit: fc69531254c
Reproduce with: ```opt -passes=loop-vectorize -mtriple=riscv64-linux-gnu -mattr=+v -scalable-vectorization=off bbi-115486_riscv.ll -S -o /dev/null```
Result:
```
opt: /repo/uabelho/main-github/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7335: VectorizationFactor llvm::LoopVectorizationPlanner::computeBestVF(): Assertion `(BestFactor.Width == LegacyVF.Width || BestPlan.hasEarlyExit() || !Legal->getLAI()->getSymbolicStrides().empty() || UsesEVLGatherScatter || planContainsAdditionalSimplifications( getPlanFor(BestFactor.Width), CostCtx, OrigLoop, BestFactor.Width) || planContainsAdditionalSimplifications( getPlanFor(LegacyVF.Width), CostCtx, OrigLoop, LegacyVF.Width)) && " VPlan cost model and legacy cost model disagreed"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: build-all-no-miracle/bin/opt -passes=loop-vectorize -mtriple=riscv64-linux-gnu -mattr=+v -scalable-vectorization=off bbi-115486_riscv.ll -S -o /dev/null
1. Running pass "function(loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>)" on module "bbi-115486_riscv.ll"
2. Running pass "loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>" on function "f"
#0 0x000056389749bed6 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build-all-no-miracle/bin/opt+0x50f0ed6)
#1 0x0000563897498b85 llvm::sys::RunSignalHandlers() (build-all-no-miracle/bin/opt+0x50edb85)
#2 0x000056389749d0e9 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007fc25e0cb990 __restore_rt (/lib64/libpthread.so.0+0x12990)
#4 0x00007fc25ba6a52f raise (/lib64/libc.so.6+0x4e52f)
#5 0x00007fc25ba3de65 abort (/lib64/libc.so.6+0x21e65)
#6 0x00007fc25ba3dd39 _nl_load_domain.cold.0 (/lib64/libc.so.6+0x21d39)
#7 0x00007fc25ba62e86 (/lib64/libc.so.6+0x46e86)
#8 0x0000563898b2f82c (build-all-no-miracle/bin/opt+0x678482c)
#9 0x0000563898b3d26f llvm::LoopVectorizePass::processLoop(llvm::Loop*) (build-all-no-miracle/bin/opt+0x679226f)
#10 0x0000563898b4816b llvm::LoopVectorizePass::runImpl(llvm::Function&) (build-all-no-miracle/bin/opt+0x679d16b)
#11 0x0000563898b48a72 llvm::LoopVectorizePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (build-all-no-miracle/bin/opt+0x679da72)
#12 0x0000563898a00d9d llvm::detail::PassModel<llvm::Function, llvm::LoopVectorizePass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) PassBuilderPipelines.cpp:0:0
#13 0x00005638976c7f15 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (build-all-no-miracle/bin/opt+0x531cf15)
#14 0x00005638989fe2bd llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) PassBuilderPipelines.cpp:0:0
#15 0x00005638976cc82e llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build-all-no-miracle/bin/opt+0x532182e)
#16 0x000056389898bb5d llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) NewPMDriver.cpp:0:0
#17 0x00005638976c6c05 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build-all-no-miracle/bin/opt+0x531bc05)
#18 0x0000563898984061 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool, bool) (build-all-no-miracle/bin/opt+0x65d9061)
#19 0x000056389743b5a7 optMain (build-all-no-miracle/bin/opt+0x50905a7)
#20 0x00007fc25ba567e5 __libc_start_main (/lib64/libc.so.6+0x3a7e5)
#21 0x00005638974387ee _start (build-all-no-miracle/bin/opt+0x508d7ee)
Abort (core dumped)
```
[bbi-115486_riscv.ll.gz](https://github.com/user-attachments/files/25604845/bbi-115486_riscv.ll.gz)
https://godbolt.org/z/v1j69vW84
Originally found for our out-of-tree target, then I fiddled a lot to get something similar to crash for riscv.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs