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

    <tr>
        <th>Summary</th>
        <td>
            Clang++-18 crash: Assertion `!isa<DbgInfoIntrinsic>(CI) && "DbgInfoIntrinsic should have been dropped during VPlan construction"' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    Clang++-18 with -O3 -mllvm -enable-vplan-native-path -fno-vectorize crashes on the test case.
Compiler explorer(assertion trunck): https://godbolt.org/z/afhMb5fb1
```
$cat mutant.cpp
#include <memory>
#define a(b, c) \
  auto d = [] b { \
    for (;;) \
      _Pragma("clang loop vectorize(enable)") c                                \
  };
void e() {
  a((size_t, size_t f, size_t g, int32_t * h, int32_t *, int32_t * i),
    for (size_t j = 0; j < g; j++) {
      int32_t k = 0;
 for (size_t l = 0; l < f; l++)
        k += i[l + j];
      h[g + j] = k;
    }) size_t m,
      f = 100, g = 100;
 std::unique_ptr<int32_t[]> n;
  std::unique_ptr<int32_t[]> o;
 std::unique_ptr<int32_t[]> i;
  d(m, f, g, &n[0], &o[0], &i[0]);
}

$clang++-18 -O3 -mllvm -enable-vplan-native-path -fno-vectorize mutant.cpp
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /usr/lib/llvm-18/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -dumpdir a- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mutant.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/root/code/my_code/diff_coverage/combine_test/mutant_dir_llvm_testset -fcoverage-compilation-dir=/root/code/my_code/diff_coverage/combine_test/mutant_dir_llvm_testset -resource-dir /usr/lib/llvm-18/lib/clang/18 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward -internal-isystem /usr/lib/llvm-18/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-slp -mllvm -enable-vplan-native-path -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/mutant-4d3cb8.o -x c++ mutant.cpp
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x00007fc6cc0cd266 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xd2b266)
 #1 0x00007fc6cc0cb170 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xd29170)
 #2 0x00007fc6cc0cd940 (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xd2b940)
 #3 0x00007fc6d6bae980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
 #4 0x00007fc6cc1eda65 llvm::Instruction::insertInto(llvm::BasicBlock*, llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void, true>, false, false>) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xe4ba65)
 #5 0x00007fc6cc1e6b0d (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xe44b0d)
 #6 0x00007fc6cc1622d6 (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xdc02d6)
 #7 0x00007fc6cd3a85ee llvm::VPWidenIntOrFpInductionRecipe::execute(llvm::VPTransformState&) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0x20065ee)
 #8 0x00007fc6cd3901e4 llvm::VPBasicBlock::execute(llvm::VPTransformState*) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0x1fee1e4)
 #9 0x00007fc6cd3924ef llvm::VPlan::execute(llvm::VPTransformState*) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0x1ff04ef)
#10 0x00007fc6cd2e0876 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*>>*) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0x1f3e876)
#11 0x00007fc6cd2ee342 llvm::LoopVectorizePass::processLoop(llvm::Loop*) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0x1f4c342)
#12 0x00007fc6cd2f2f17 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*) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0x1f50f17)
#13 0x00007fc6cd2f33b8 llvm::LoopVectorizePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0x1f513b8)
#14 0x00007fc6cf0a16ed (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0x3cff6ed)
#15 0x00007fc6cc248b04 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xea6b04)
#16 0x00007fc6ce0cdadd (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0x2d2badd)
#17 0x00007fc6cc24c311 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xeaa311)
#18 0x00007fc6ce0cd8fd (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0x2d2b8fd)
#19 0x00007fc6cc247864 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xea5864)
#20 0x00007fc6d48b6d43 (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1ae4d43)
#21 0x00007fc6d48afd52 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1addd52)
#22 0x00007fc6d4c465fe (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1e745fe)
#23 0x00007fc6d3862866 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0xa90866)
#24 0x00007fc6d56ba645 clang::FrontendAction::Execute() (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x28e8645)
#25 0x00007fc6d5638cc4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x2866cc4)
#26 0x00007fc6d57351c0 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x29631c0)
#27 0x000055ec42762837 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-18/bin/clang+0x13837)
#28 0x000055ec4275f905 (/usr/lib/llvm-18/bin/clang+0x10905)
#29 0x000055ec4275ea8e clang_main(int, char**, llvm::ToolContext const&) (/usr/lib/llvm-18/bin/clang+0xfa8e)
#30 0x000055ec4276cf32 main (/usr/lib/llvm-18/bin/clang+0x1df32)
#31 0x00007fc6ca5b1c87 __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:344:0
#32 0x000055ec4275c1ea _start (/usr/lib/llvm-18/bin/clang+0xd1ea)
clang++-18: error: unable to execute command: Segmentation fault (core dumped)
clang++-18: error: clang frontend command failed due to signal (use -v to see invocation)
Ubuntu clang version 18.0.0 (++20231018091808+48a53509e851-1~exp1~20231018091910.1571)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang++-18: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++-18: note: diagnostic msg: /tmp/mutant-587d27.cpp
clang++-18: note: diagnostic msg: /tmp/mutant-587d27.sh
clang++-18: note: diagnostic msg: 

********************
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMWl9z4yqy_zTKCyWXhP5YfsiDY8fn5NbMTWqSnVN1X1wIWjJnJNACyiTnYT_7LZBsC8fzJ3NcuzvlmkjQdP-6abobBNGa1wLgOshugm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