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

    <tr>
        <th>Summary</th>
        <td>
            [SLPVectorizer] Instruction does not dominate all uses!.. LLVM ERROR: Broken module found, compilation aborted!
        </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 -slp-threshold=-99999:

```
; 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 void @wombat(i32 %arg) #0 gc "statepoint-example" {
bb:
  br label %bb14

bb1: ; preds = %bb14, %bb14
  %add = add i32 0, 0
  br label %bb2

bb2:                                              ; preds = %bb14, %bb1
  %phi = phi i32 [ 0, %bb14 ], [ 0, %bb1 ]
  %phi3 = phi i32 [ 0, %bb14 ], [ 0, %bb1 ]
  %phi4 = phi i32 [ 0, %bb14 ], [ %arg, %bb1 ]
 %phi5 = phi i32 [ 0, %bb14 ], [ 0, %bb1 ]
  %phi6 = phi i32 [ 0, %bb14 ], [ 0, %bb1 ]
  %phi7 = phi i32 [ 0, %bb14 ], [ %add, %bb1 ]
  %phi8 = phi i32 [ %arg, %bb14 ], [ 0, %bb1 ]
  %phi9 = phi i32 [ 0, %bb14 ], [ 0, %bb1 ]
 %add10 = add i32 %phi, 0
  br i1 false, label %bb14, label %bb11

bb11: ; preds = %bb2
  %phi12 = phi i32 [ %phi6, %bb2 ]
  %phi13 = phi i32 [ %phi7, %bb2 ]
  br label %bb14

bb14: ; preds = %bb11, %bb2, %bb
 %phi15 = phi i32 [ %phi3, %bb2 ], [ 0, %bb ], [ 0, %bb11 ]
  %phi16 = phi i32 [ %add10, %bb2 ], [ 0, %bb ], [ 0, %bb11 ]
  %phi17 = phi i32 [ %phi7, %bb2 ], [ 0, %bb ], [ 0, %bb11 ]
  %phi18 = phi i32 [ %phi8, %bb2 ], [ 0, %bb ], [ 0, %bb11 ]
  switch i32 0, label %bb2 [
    i32 0, label %bb1
 i32 1, label %bb1
  ]
}

attributes #0 = { "target-features"="+prfchw,-cldemote,+avx,+aes,+sahf,+pclmul,-xop,+crc32,-amx-fp8,+xsaves,-avx512fp16,-usermsr,-sm4,-egpr,+sse4.1,-avx512ifma,+xsave,+sse4.2,-tsxldtrk,-sm3,-ptwrite,-widekl,-movrs,-invpcid,+64bit,+xsavec,-avx10.1-512,-avx512vpopcntdq,+cmov,-avx512vp2intersect,-avx512cd,+movbe,-avxvnniint8,-ccmp,-amx-int8,-kl,-avx10.1-256,-sha512,-avxvnni,-rtm,+adx,+avx2,-hreset,-movdiri,-serialize,-vpclmulqdq,-avx512vl,-uintr,-cf,+clflushopt,-raoint,-cmpccxadd,+bmi,-amx-tile,+sse,-avx10.2-256,-gfni,-avxvnniint16,-amx-fp16,-zu,-ndd,+xsaveopt,+rdrnd,-avx512f,-amx-bf16,-avx512bf16,-avx512vnni,-push2pop2,+cx8,-avx512bw,+sse3,-pku,-nf,-amx-tf32,-amx-avx512,+fsgsbase,+clzero,-mwaitx,-lwp,+lzcnt,+sha,-movdir64b,-ppx,+wbnoinvd,-enqcmd,-amx-transpose,-avx10.2-512,-avxneconvert,-tbm,-pconfig,-amx-complex,+ssse3,+cx16,+bmi2,+fma,+popcnt,-avxifma,+f16c,-avx512bitalg,-rdpru,+clwb,+mmx,+sse2,+rdseed,-avx512vbmi2,-prefetchi,-amx-movrs,+rdpid,-fma4,-avx512vbmi,-shstk,-vaes,-waitpkg,-sgx,+fxsr,-avx512dq,+sse4a" }

Reproducer: https://godbolt.org/z/c3T5fjhTh

Stack dump:
```
0.      Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/opt -o /app/output.s -S -passes=slp-vectorizer -slp-threshold=-99999 <source>
1.      Running pass "verify" on module "<source>"
 #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 0x0000767172242520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007671722969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x0000767172242476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007671722287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x0000000000826751 llvm::json::operator==(llvm::json::Value const&, llvm::json::Value const&) (.cold) JSON.cpp:0:0
 #7 0x00000000055a9e41 (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x55a9e41)
 #8 0x00000000054a42e8 (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x54a42e8)
 #9 0x00000000009637ce llvm::detail::PassModel<llvm::Module, llvm::VerifierPass, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x9637ce)
#10 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)
#11 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)
#12 0x0000000000961b7b optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x961b7b)
#13 0x0000767172229d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#14 0x0000767172229e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#15 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/eJzcWU1z4yrW_jVkQ8kloe9FFk7Svm-_05nblaR6m0ISsrlBQAOynfz6KUCyJCep6XRnNSnHRnDOc76BY2Ot6ZYTcgnSK5DeXODe7IS6fMDmGXN8I_rK6ItKNM-XDwIqIpVo-ppA1XMopIEHanbQ7Ag0RBtYESYOsNeUb2EgsdZEg_hGMxnsSW2Eoi9EwcA-m50ieidYA-KboLR_IF6D0L2ycHiFaxBfwVvR9Ix8vYEgvoEA5SuANopYLZoVYwDlIFxr0auaPLaUEY47MpCic1IEwrXBaksMbLDBDD-L3ozEJOhAvCaBRHkI4nWM3Jt9jJaPdpQl7i2gp0GEChCvI1QEbREOI-6mspE9S4J7N03tdCDRuFAM_zHya2ihqlFUspNNxyJ7zJKg509cHHjAKO-PwZb3ngWE64a0lBO4F7SBIAkPoquwAaigMYIApVhtASohQHEIt7VF1AYbIgXlJiBH3ElGAEIQ5FcgXFeVjwuElYIMV4RZjKqKEi-sqqxzoI2TVKTRg5aeAl3PiKET3jSOwn5afUJLE76Bj0Z46x74ob__osuoitxRR2A_nWvSK6_OwAFBeuMel_NueoKIPwEj-WWMMXznQB4n_QRdsk_AyD9kT9O8C1S8Ajp3wC9qVP6JVV7JKFwkrsddZC-NYIuZJnZyWSlnE9GpdN6rHTTTPUJvecGG6qQqOjM3ep2VQ2TeYHm3rpP3Cjua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