<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95520>95520</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Assertion `hasVectorValue(Def, Instance.Part)' failed.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
TatyanaDoubts
</td>
</tr>
</table>
<pre>
To reproduce run the following test opt with -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 i32 @wombat() gc "statepoint-example" {
bb:
br label %bb2
bb1: ; preds = %bb2
ret i32 0
bb2: ; preds = %bb2, %bb
%phi = phi i64 [ 0, %bb ], [ %add, %bb2 ]
%phi3 = phi i32 [ 0, %bb ], [ %load, %bb2 ]
%add = add i64 %phi, 1
%load = load i32, ptr addrspace(1) null, align 4
%icmp = icmp ult i64 %phi, 1
br i1 %icmp, label %bb2, label %bb1
}
```
Reproducer: https://godbolt.org/z/cv7Tf3vba
Stack dump:
```
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/opt -o /app/output.s -S -passes loop-vectorize <source>
#0 0x0000000004e41688 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x4e41688)
#1 0x0000000004e3eddc SignalHandler(int) Signals.cpp:0:0
#2 0x00007ec2abe42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x00007ec2abe969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x00007ec2abe42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x00007ec2abe287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x00007ec2abe2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x00007ec2abe39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x0000000003fecdce (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3fecdce)
#9 0x0000000004008abe llvm::VPInstruction::generatePerPart(llvm::VPTransformState&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x4008abe)
#10 0x000000000400ae5e llvm::VPInstruction::execute(llvm::VPTransformState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x400ae5e)
#11 0x0000000003fe5fbf llvm::VPBasicBlock::executeRecipes(llvm::VPTransformState*, llvm::BasicBlock*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3fe5fbf)
#12 0x0000000003fe9cb0 llvm::VPBasicBlock::execute(llvm::VPTransformState*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3fe9cb0)
#13 0x0000000003feda3e llvm::VPlan::execute(llvm::VPTransformState*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3feda3e)
#14 0x0000000003eda4e5 llvm::LoopVectorizationPlanner::executePlan(llvm::ElementCount, unsigned int, llvm::VPlan&, llvm::InnerLoopVectorizer&, llvm::DominatorTree*, bool, llvm::DenseMap<llvm::SCEV const*, llvm::Value*, llvm::DenseMapInfo<llvm::SCEV const*, void>, llvm::detail::DenseMapPair<llvm::SCEV const*, llvm::Value*>> const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3eda4e5)
#15 0x0000000003eef18b llvm::LoopVectorizePass::processLoop(llvm::Loop*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3eef18b)
#16 0x0000000003ef1a4d llvm::LoopVectorizePass::runImpl(llvm::Function&, llvm::ScalarEvolution&, llvm::LoopInfo&, llvm::TargetTransformInfo&, llvm::DominatorTree&, llvm::BlockFrequencyInfo*, llvm::TargetLibraryInfo*, llvm::DemandedBits&, llvm::AssumptionCache&, llvm::LoopAccessInfoManager&, llvm::OptimizationRemarkEmitter&, llvm::ProfileSummaryInfo*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3ef1a4d)
#17 0x0000000003ef2c5b llvm::LoopVectorizePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3ef2c5b)
#18 0x0000000002e0679e 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+0x2e0679e)
#19 0x0000000004c49a6c llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x4c49a6c)
#20 0x0000000000dbabee 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+0xdbabee)
#21 0x0000000004c483ae llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x4c483ae)
#22 0x0000000000dbc65e 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+0xdbc65e)
#23 0x0000000004c462bc llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x4c462bc)
#24 0x00000000008db912 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) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x8db912)
#25 0x00000000008ceabc optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x8ceabc)
#26 0x00007ec2abe29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#27 0x00007ec2abe29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#28 0x00000000008c5f0e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x8c5f0e)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcWV1vszjT_jXuiZUIzEfgIAdp0-xbvVttdafqaWVgSPzU2Dy26cf--kc2JI1perfZzUqru2oC2DOXrxlf4xigWrONAJij5BIlywvama1U83tq3qigS9kVRl8Usnqb30usoFWy6krAqhPYbAHXknP5wsQGG9AGy9bgF2a2eNJSrUFjLmU7eYbSSMX-BBQtULBEwQKlwfDfX0aX-FZWHYebJUbREiMymyKyUmAHq6acIzLrTbXsVAmPNeMgaAODNRlbk97aULUBgytqKKdvsjM7e5g0KFrApCWzAEWLiLgvexn6l_Ysjd3XhO1PQpKhaBGSbFJnwXAmXFO6c0_jydo1M9s8acmuIxs-Een7yJitUazl-8hes_QxjSedeBLyRUw4E93rZCO6vVf_XUHNBGAWEYzi4EU2BTWIZIjkeFNaHG2ogVYyYSbwSpuWAyIEo9ll718U-8nBuFCY0wI4RiQpCm-corAJwnbGWgWVHmi-m2GswDgege9HPvUjV_3ZDgCRpN0yZ2GPLI0xSi5xsDfEKFm6i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