| Issue |
176720
|
| Summary |
Assertion `(BestFactor.Width == LegacyVF.Width || BestPlan.hasEarlyExit() || ... || planContainsAdditionalSimplifications( getPlanFor(LegacyVF.Width), CostCtx, OrigLoop, LegacyVF.Width)) && " VPlan cost model and legacy cost model disagreed"' failed.
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
TatyanaDoubts
|
```
opt: /root/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7269: llvm::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.
```
To reproduce run opt with the test below (-passes=loop-vectorize).
```
; ModuleID = './reduced.ll'
source_filename = "./reduced.ll"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
target triple = "x86_64-unknown-linux-gnu"
define void @wombat() #0 gc "statepoint-example" {
bb:
br label %bb2
bb1: ; preds = %bb2
%phi = phi i32 [ %or8, %bb2 ]
ret void
bb2: ; preds = %bb2, %bb
%phi3 = phi i32 [ 0, %bb ], [ %sdiv, %bb2 ]
%phi4 = phi i32 [ 0, %bb ], [ %add, %bb2 ]
%or = or i32 0, 0
%sdiv = sdiv i32 0, %or
%sub = sub i32 0, %sdiv
%or5 = or i32 %sub, %phi3
%or6 = or i32 %sdiv, 1
%sdiv7 = sdiv i32 %sdiv, %or6
%or8 = or i32 %or5, %sdiv7
%add = add i32 %phi4, 3
%icmp = icmp ugt i32 %phi4, 35
br i1 %icmp, label %bb1, label %bb2
}
attributes #0 = { "target-cpu"="skylake-avx512" }
```
Reproducer: https://godbolt.org/z/rzsds3acz
Stack dump:
```
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/opt -o /app/output.s -S -passes=loop-vectorize <source>
1. Running pass "function(loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>)" on module "<source>"
2. Running pass "loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>" on function "wombat"
#0 0x0000000005a80c68 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5a80c68)
#1 0x0000000005a7db44 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x00007d0067042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x00007d00670969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x00007d0067042476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x00007d00670287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x00007d006702871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x00007d0067039e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x0000000003749648 llvm::LoopVectorizationPlanner::computeBestVF() (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3749648)
#9 0x000000000374b5d2 llvm::LoopVectorizePass::processLoop(llvm::Loop*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x374b5d2)
#10 0x000000000374e770 llvm::LoopVectorizePass::runImpl(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x374e770)
#11 0x000000000374eefd llvm::LoopVectorizePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x374eefd)
#12 0x000000000302291e llvm::detail::PassModel<llvm::Function, llvm::LoopVectorizePass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x302291e)
#13 0x00000000057f51c1 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x57f51c1)
#14 0x0000000000f07e1e llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0xf07e1e)
#15 0x00000000057f377a llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x57f377a)
#16 0x000000000096470e llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x96470e)
#17 0x00000000057f3131 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x57f3131)
#18 0x000000000096e8ca 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) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x96e8ca)
#19 0x0000000000962978 optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x962978)
#20 0x00007d0067029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#21 0x00007d0067029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#22 0x00000000009595f5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x9595f5)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs