<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/72034>72034</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
vectorcombine crash
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
regehr
</td>
</tr>
</table>
<pre>
```llvm
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare <4 x i64> @llvm.vp.add.v4i64(<4 x i64>, <4 x i64>, <4 x i1>, i32) #0
define <4 x i64> @add_v4i64_allonesmask(<4 x i64> %x) {
%1 = shufflevector <4 x i64> %x, <4 x i64> zeroinitializer, <4 x i32> zeroinitializer
%2 = call <4 x i64> @llvm.vp.add.v4i64(<4 x i64> %1, <4 x i64> zeroinitializer, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, i32 0)
ret <4 x i64> %2
}
; uselistorder directives
uselistorder <4 x i64> zeroinitializer, { 1, 0 }
attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) }
```
crashes:
```
regehr@john-home:~/out$ ~/llvm-project/for-alive/bin/opt -O2 reduced.ll
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.
opt: /home/regehr/llvm-project/llvm/include/llvm/Support/Casting.h:662: decltype(auto) llvm::dyn_cast(From*) [with To = llvm::Constant; From = llvm::Value]: Assertion `detail::isPresent(Val) && "dyn_cast on a non-existent value"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /home/regehr/llvm-project/for-alive/bin/opt -O2 reduced.ll
#0 0x00007fd0531fe950 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMSupport.so.18git+0x1fe950)
#1 0x00007fd0531fb95f llvm::sys::RunSignalHandlers() (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMSupport.so.18git+0x1fb95f)
#2 0x00007fd0531fbab5 SignalHandler(int) Signals.cpp:0:0
#3 0x00007fd052842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007fd0528969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#5 0x00007fd0528969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#6 0x00007fd0528969fc pthread_kill ./nptl/pthread_kill.c:89:10
#7 0x00007fd052842476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#8 0x00007fd0528287f3 abort ./stdlib/abort.c:81:7
#9 0x00007fd05282871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x00007fd052839e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x00007fd05352aa14 (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMCore.so.18git+0x12aa14)
#12 0x00007fd055ae3085 llvm::IRBuilderBase::CreateBinOp(llvm::Instruction::BinaryOps, llvm::Value*, llvm::Value*, llvm::Twine const&, llvm::MDNode*) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMVectorize.so.18git+0xe3085)
#13 0x00007fd055b89d2d (anonymous namespace)::VectorCombine::scalarizeVPIntrinsic(llvm::Instruction&) VectorCombine.cpp:0:0
#14 0x00007fd055b96522 llvm::VectorCombinePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMVectorize.so.18git+0x196522)
#15 0x00007fd0564b85f6 llvm::detail::PassModel<llvm::Function, llvm::VectorCombinePass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMPasses.so.18git+0xb85f6)
#16 0x00007fd05a983b01 llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMAMDGPUCodeGen.so.18git+0x383b01)
#17 0x00007fd053b77375 llvm::CGSCCToFunctionPassAdaptor::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMAnalysis.so.18git+0x177375)
#18 0x00007fd05a963886 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::CGSCCToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMAMDGPUCodeGen.so.18git+0x363886)
#19 0x00007fd053b70f40 llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMAnalysis.so.18git+0x170f40)
#20 0x00007fd0564b7b56 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMPasses.so.18git+0xb7b56)
#21 0x00007fd053b78696 llvm::DevirtSCCRepeatedPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMAnalysis.so.18git+0x178696)
#22 0x00007fd0564b7ba6 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::DevirtSCCRepeatedPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMPasses.so.18git+0xb7ba6)
#23 0x00007fd053b730f4 llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMAnalysis.so.18git+0x1730f4)
#24 0x00007fd0564b7b06 llvm::detail::PassModel<llvm::Module, llvm::ModuleToPostOrderCGSCCPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMPasses.so.18git+0xb7b06)
#25 0x00007fd0537238f1 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMCore.so.18git+0x3238f1)
#26 0x00007fd056024e44 llvm::ModuleInlinerWrapperPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMipo.so.18git+0x224e44)
#27 0x00007fd0564b70e6 llvm::detail::PassModel<llvm::Module, llvm::ModuleInlinerWrapperPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMPasses.so.18git+0xb70e6)
#28 0x00007fd0537238f1 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/regehr/llvm-project/for-alive/bin/../lib/libLLVMCore.so.18git+0x3238f1)
#29 0x000056350c993034 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) (/home/regehr/llvm-project/for-alive/bin/opt+0x31034)
#30 0x000056350c98109c main (/home/regehr/llvm-project/for-alive/bin/opt+0x1f09c)
#31 0x00007fd052829d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#32 0x00007fd052829e40 call_init ./csu/../csu/libc-start.c:128:20
#33 0x00007fd052829e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#34 0x000056350c984f95 _start (/home/regehr/llvm-project/for-alive/bin/opt+0x22f95)
Aborted (core dumped)
regehr@john-home:~/out$
```
cc @hatsunespica
</pre>
<img width="1px" height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