<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/151699>151699</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Assertion `FromCIValue.isZero() && "Cannot convert the instruction."' 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 opt with the test below using -passes=slp-vectorizer:
```
; 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 i64 @wombat() gc "statepoint-example" {
bb:
%shl = shl i32 0, 1
%mul = mul i32 0, 0
%add = add i32 0, 0
%add1 = add i32 0, 1
br label %bb2
bb2: ; preds = %bb
%phi = phi i32 [ %shl, %bb ]
%phi3 = phi i32 [ %add, %bb ]
%phi4 = phi i32 [ %mul, %bb ]
%phi5 = phi i32 [ %add1, %bb ]
ret i64 0
}
```
Reproducer: https://godbolt.org/z/xzPc7WYTj
Stack dump:
```
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/opt -o /app/output.s -S -passes=slp-vectorizer <source>
1. Running pass "function(slp-vectorizer)" on module "<source>"
2. Running pass "slp-vectorizer" on function "wombat"
#0 0x00000000056729e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x56729e8)
#1 0x000000000566f894 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x000072a8c4e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x000072a8c4e969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x000072a8c4e42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x000072a8c4e287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x000072a8c4e2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x000072a8c4e39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x00000000034cc914 (anonymous namespace)::convertTo(llvm::Instruction*, (anonymous namespace)::InstructionsState const&) SLPVectorizer.cpp:0:0
#9 0x000000000350e89c (anonymous namespace)::InstructionsCompatibilityAnalysis::buildOperands((anonymous namespace)::InstructionsState const&, llvm::ArrayRef<llvm::Value*>) SLPVectorizer.cpp:0:0
#10 0x000000000357aaed llvm::slpvectorizer::BoUpSLP::buildTreeRec(llvm::ArrayRef<llvm::Value*>, unsigned int, llvm::slpvectorizer::BoUpSLP::EdgeInfo const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x357aaed)
#11 0x000000000357d1d1 llvm::slpvectorizer::BoUpSLP::buildTreeRec(llvm::ArrayRef<llvm::Value*>, unsigned int, llvm::slpvectorizer::BoUpSLP::EdgeInfo const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x357d1d1)
#12 0x00000000035ab251 llvm::SLPVectorizerPass::tryToVectorizeList(llvm::ArrayRef<llvm::Value*>, llvm::slpvectorizer::BoUpSLP&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x35ab251)
#13 0x00000000035b0066 bool tryToVectorizeSequence<llvm::Value>(llvm::SmallVectorImpl<llvm::Value*>&, llvm::function_ref<bool (llvm::Value*, llvm::Value*)>, llvm::function_ref<bool (llvm::Value*, llvm::Value*)>, llvm::function_ref<bool (llvm::ArrayRef<llvm::Value*>, bool)>, bool, llvm::slpvectorizer::BoUpSLP&) (.constprop.0) SLPVectorizer.cpp:0:0
#14 0x00000000035b17cf llvm::SLPVectorizerPass::vectorizeChainsInBlock(llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x35b17cf)
#15 0x00000000035b97f6 llvm::SLPVectorizerPass::runImpl(llvm::Function&, llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*) (.part.0) SLPVectorizer.cpp:0:0
#16 0x00000000035ba2db llvm::SLPVectorizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x35ba2db)
#17 0x0000000002db658e llvm::detail::PassModel<llvm::Function, llvm::SLPVectorizerPass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x2db658e)
#18 0x0000000005464431 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5464431)
#19 0x0000000000ebde5e 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+0xebde5e)
#20 0x0000000005464904 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5464904)
#21 0x00000000009637fe 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+0x9637fe)
#22 0x00000000054624d1 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x54624d1)
#23 0x000000000096daca 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+0x96daca)
#24 0x0000000000961b7b optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x961b7b)
#25 0x000072a8c4e29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#26 0x000072a8c4e29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#27 0x0000000000958c35 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x958c35)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsWd9v4yoW_mvoC0pk498PeXDTyd1qp5qq6c5q9yXChiTcYvACbpv561dgp46ddCaZ26u9Gm3V1o7hfJzz8Z0TwFhrthGUzkB0DaKbK9yYrVSzR2x2WOAb2RRGXxWS7GaPEipaK0makkLVCChrA1-Y2UKzpdBQbWBBuXyBjWZiAyc11ppqENxoXk-eaWmkYt-oAkEOvBzEXvfr5SC4hneSNJze3kAQ3ECAkilAC0XtUGTKOUAJ8HItG1XS1ZpxKnBFu65o3BUBLzdYbaiBBBvM8U42Zt-ZTioQ5HRSo8QDQR4g989-9Icf7V0cun8T9nbjoxQEuY_SyTr1ujvhHsV78zicLN1jZh9ParRvSLu_ALVtaOCqUazmbzG9pvEqDieNeBLyRUw4E83rZCOa1gR4OaFrJihkcQhB6L3IqsAGoBSgDG5Ki6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