<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/131071>131071</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [LoopVectorize] Assertion `ID != Intrinsic::not_intrinsic && "Not an intrinsic!"' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            loopoptim,
            vectorizers,
            crash-on-valid
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dtcxzyw
      </td>
    </tr>
</table>

<pre>
    Reproducer: https://godbolt.org/z/n7E1TjTv5
```
; bin/opt -passes=loop-vectorize -enable-vplan-native-path reduced.ll -S
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"
target triple = "x86_64-unknown-linux-gnu"

define i32 @main() {
entry:
  br label %for.cond2.preheader.i815

for.cond2.preheader.i815: ; preds = %for.cond.cleanup8.i835.split.us, %entry
  %I.03.i816 = phi i64 [ %inc20.i839, %for.cond.cleanup8.i835.split.us ], [ 0, %entry ]
  br label %cont.i830.us

cont.i830.us:                                     ; preds = %cont.i830.us, %for.cond2.preheader.i815
  %K.01.i824.us = phi i64 [ 0, %for.cond2.preheader.i815 ], [ %inc.i833.us, %cont.i830.us ]
  call void @use(ptr null, i64 0)
  %inc.i833.us = add i64 %K.01.i824.us, 1
 %exitcond.not.i834.us = icmp eq i64 %inc.i833.us, 0
  br i1 %exitcond.not.i834.us, label %for.cond.cleanup8.i835.split.us, label %cont.i830.us

for.cond.cleanup8.i835.split.us:                  ; preds = %cont.i830.us
  %inc20.i839 = add i64 %I.03.i816, 1
  %exitcond5.not.i840 = icmp eq i64 %inc20.i839, 0
  br i1 %exitcond5.not.i840, label %"_ZZ4mainENK3$_7clEmmmPi.exit.loopexit1081", label %for.cond2.preheader.i815, !llvm.loop !0

"_ZZ4mainENK3$_7clEmmmPi.exit.loopexit1081":      ; preds = %for.cond.cleanup8.i835.split.us
  ret i32 0
}

declare void @use(ptr, i64)

!0 = distinct !{!0, !1, !2}
!1 = !{!"llvm.loop.mustprogress"}
!2 = !{!"llvm.loop.vectorize.enable", i1 true}
```
```
opt: /root/llvm-project/llvm/lib/Analysis/VectorUtils.cpp:175: bool llvm::isVectorIntrinsicWithOverloadTypeAtArg(llvm::Intrinsic::ID, int, const llvm::TargetTransformInfo*): Assertion `ID != Intrinsic::not_intrinsic && "Not an intrinsic!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/opt -o /app/output.s -S -passes=loop-vectorize -enable-vplan-native-path <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 "main"
 #0 0x0000000005475858 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5475858)
 #1 0x0000000005473214 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x00007024fda42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007024fda969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007024fda42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007024fda287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00007024fda2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x00007024fda39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x0000000004bea5d7 (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x4bea5d7)
 #9 0x00000000045582f0 llvm::VPWidenIntrinsicRecipe::execute(llvm::VPTransformState&) (.part.0) VPlanRecipes.cpp:0:0
#10 0x0000000004513ea7 llvm::VPBasicBlock::executeRecipes(llvm::VPTransformState*, llvm::BasicBlock*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x4513ea7)
#11 0x000000000451e4cf llvm::VPBasicBlock::execute(llvm::VPTransformState*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x451e4cf)
#12 0x000000000451f5c0 llvm::VPRegionBlock::execute(llvm::VPTransformState*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x451f5c0)
#13 0x000000000451f5c0 llvm::VPRegionBlock::execute(llvm::VPTransformState*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x451f5c0)
#14 0x000000000452b451 llvm::VPlan::execute(llvm::VPTransformState*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x452b451)
#15 0x00000000043ddd2f 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+0x43ddd2f)
#16 0x00000000043f0e36 llvm::LoopVectorizePass::processLoop(llvm::Loop*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x43f0e36)
#17 0x00000000043f45e9 llvm::LoopVectorizePass::runImpl(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x43f45e9)
#18 0x00000000043f4c63 llvm::LoopVectorizePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x43f4c63)
#19 0x000000000319510e 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+0x319510e)
#20 0x0000000005270840 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5270840)
#21 0x0000000000e79f8e 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+0xe79f8e)
#22 0x000000000526f15b llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x526f15b)
#23 0x0000000000e7910e 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+0xe7910e)
#24 0x000000000526eb60 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x526eb60)
#25 0x000000000094151a 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+0x94151a)
#26 0x0000000000934c6c optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x934c6c)
#27 0x00007024fda29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#28 0x00007024fda29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#29 0x000000000092c755 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x92c755)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
Reduced from llvm-test-suite/SingleSource/UnitTests/Vectorizer/VPlanNativePath/outer-loop-vect.cpp with ubsan+https://github.com/llvm/llvm-project/pull/130990 enabled



</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzcWl1z4yYX_jXkhpEGgSRLF7lQPtx3p902s07Tmd5ksIRtuhj0Asom_fXvALIlOR8bb91p380ksT44D895OByOhKkxfC0ZOwfZBciuzmhnN0qfN7Z-_PPpy9lSNU_nn1irVdPVTANSwY21rQGkAngO8HytmqUSNlZ6DfD8T4Dncnad3P5x-5ABVIEc9b-oAuQCLrkEeK5aC6OWGsMMIFdCqTZ6YLVVmv_JYMQkXQoWPbSCykhSyx9Y1FK7gZo5Dk0sBIwWAFWW6jWzsKGWCvqkOgsBuYIAYxZtAalY1OIZAqQi2P9zp8n01B3lqf8X8f1BggtAqgQX0apA_ZH0l_KdeZ5GC9cM44GH1bwVbMfhscjv8zTq5GepvshIcNk9RmvZBROAqoatuGSQEwxBirbUKVMAXEIwuwCoYtLqJ6cyqiBcaijokgkIcLZSOq6VbHDcarZhtGE65kWSBdRX75IKugFoNWtMz3EPFdeCUdm1RcwLksWmFdzGnQH40rUKTBwNgLMPMSIOMPcY7YZDnqcQZBfuJpc1Rg6j7E2_0gEE2ZVvmV1ANO7N3zh0vFbSOnvkqHlnJ1dIBd_z80yECciU9gsSexF-jFES8wKn3ocDHdBXQMZOB81c72TofUxoL0RNhYAPijcuWDrDAC5aq6HshHBmrnMEcLljOEL1BGnTBIJT8s40cTZO-Edu_VhJ5bvfO8frbQvZf3f2B4TRbpx48hqKa_YsfN-IuTdG_GvWLwXB2yM-CNaH7qFe-4jfizX2M-sdTdErWo0mxCtSDRAT5wHG97__nrrEcP3zjwTg9H5Wi-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