Bug type: crash
Component: SLPVectorizer
Bug location: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp: BoUpSLP::buildTree_rec
Issue title: SLPVectorizer miscompilation
Labels: miscompilation
llvm:SLPVectorizer
Reported by: Zentrik

This IR
```llvm
; Function Attrs: alignstack(16)
define swiftcc { ptr addrspace(10), i8 } @julia__zip_iterate_all_17381(ptr noalias nocapture noundef nonnull align 4 dereferenceable(96) %union_bytes_return, ptr nonnull swiftself %pgcstack_arg, ptr addrspace(11) nocapture noundef nonnull readonly align 4 dereferenceable(48) %0, ptr addrspace(11) nocapture noundef nonnull readonly align 4 dereferenceable(48) %1) #0 {
top:
  %pgcstack = call ptr @julia.get_pgcstack()
  %ptls_field = getelementptr inbounds i8, ptr %pgcstack, i32 8
  %ptls_load = load ptr, ptr %ptls_field, align 4
  %2 = getelementptr inbounds i8, ptr %ptls_load, i32 16
  %safepoint = load ptr, ptr %2, align 4
  fence syncscope("singlethread") seq_cst
  call void @julia.safepoint(ptr %safepoint)
  fence syncscope("singlethread") seq_cst
  %3 = load i32, ptr addrspace(11) %1, align 4
  %4 = load i32, ptr addrspace(11) %0, align 4
  %.not = icmp eq i32 %3, %4
  br i1 %.not, label %L26, label %L20

L20:                                              ; preds = %top
  %5 = add i32 %3, 1
  %6 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 4
  %7 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 8
  %8 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 12
  %9 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 16
  %10 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 20
  %.not265 = icmp eq ptr addrspace(11) %6, null
  %11 = load i32, ptr addrspace(11) %6, align 4
  %12 = select i1 %.not265, i32 undef, i32 %11
  %.not266 = icmp eq ptr addrspace(11) %7, null
  %13 = load i32, ptr addrspace(11) %7, align 4
  %14 = select i1 %.not266, i32 undef, i32 %13
  %.not267 = icmp eq ptr addrspace(11) %8, null
  %15 = load i32, ptr addrspace(11) %8, align 4
  %16 = select i1 %.not267, i32 undef, i32 %15
  %.not268 = icmp eq ptr addrspace(11) %9, null
  %17 = load i32, ptr addrspace(11) %9, align 4
  %18 = select i1 %.not268, i32 undef, i32 %17
  %.not269 = icmp eq ptr addrspace(11) %10, null
  %19 = load i32, ptr addrspace(11) %10, align 4
  %20 = select i1 %.not269, i32 undef, i32 %19
  br label %L112

L26:                                              ; preds = %top
  %21 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 4
  %22 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 8
  %23 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 12
  %24 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 16
  %25 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 20
  %26 = getelementptr inbounds i8, ptr addrspace(11) %0, i32 4
  %27 = getelementptr inbounds i8, ptr addrspace(11) %0, i32 12
  %28 = getelementptr inbounds i8, ptr addrspace(11) %0, i32 16
  %29 = getelementptr inbounds i8, ptr addrspace(11) %0, i32 20
  %30 = load i32, ptr addrspace(11) %21, align 4
  %31 = load i32, ptr addrspace(11) %26, align 4
  %.not275 = icmp eq i32 %30, %31
  br i1 %.not275, label %L42, label %L41

L41:                                              ; preds = %L26
  %32 = add i32 %30, 1
  %.not276 = icmp eq ptr addrspace(11) %22, null
  %33 = load i32, ptr addrspace(11) %22, align 4
  %34 = select i1 %.not276, i32 undef, i32 %33
  %.not277 = icmp eq ptr addrspace(11) %23, null
  %35 = load i32, ptr addrspace(11) %23, align 4
  %36 = select i1 %.not277, i32 undef, i32 %35
  %.not278 = icmp eq ptr addrspace(11) %24, null
  %37 = load i32, ptr addrspace(11) %24, align 4
  %38 = select i1 %.not278, i32 undef, i32 %37
  %.not279 = icmp eq ptr addrspace(11) %25, null
  %39 = load i32, ptr addrspace(11) %25, align 4
  %40 = select i1 %.not279, i32 undef, i32 %39
  br label %L112

L42:                                              ; preds = %L26
  %41 = getelementptr inbounds i8, ptr addrspace(11) %0, i32 8
  %42 = load i32, ptr addrspace(11) %22, align 4
  %43 = load i32, ptr addrspace(11) %41, align 4
  %.not280 = icmp eq i32 %42, %43
  br i1 %.not280, label %L48, label %L47

L47:                                              ; preds = %L42
  %44 = add i32 %42, 1
  %.not281 = icmp eq ptr addrspace(11) %23, null
  %45 = load i32, ptr addrspace(11) %23, align 4
  %46 = select i1 %.not281, i32 undef, i32 %45
  %.not282 = icmp eq ptr addrspace(11) %24, null
  %47 = load i32, ptr addrspace(11) %24, align 4
  %48 = select i1 %.not282, i32 undef, i32 %47
  %.not283 = icmp eq ptr addrspace(11) %25, null
  %49 = load i32, ptr addrspace(11) %25, align 4
  %50 = select i1 %.not283, i32 undef, i32 %49
  br label %L112

L48:                                              ; preds = %L42
  %51 = load i32, ptr addrspace(11) %23, align 4
  %52 = load i32, ptr addrspace(11) %27, align 4
  %.not284 = icmp eq i32 %51, %52
  br i1 %.not284, label %L54, label %L53

L53:                                              ; preds = %L48
  %53 = add i32 %51, 1
  %.not285 = icmp eq ptr addrspace(11) %24, null
  %54 = load i32, ptr addrspace(11) %24, align 4
  %55 = select i1 %.not285, i32 undef, i32 %54
  %.not286 = icmp eq ptr addrspace(11) %25, null
  %56 = load i32, ptr addrspace(11) %25, align 4
  %57 = select i1 %.not286, i32 undef, i32 %56
  br label %L112

L54:                                              ; preds = %L48
  %58 = load i32, ptr addrspace(11) %24, align 4
  %59 = load i32, ptr addrspace(11) %28, align 4
  %.not287 = icmp eq i32 %58, %59
  br i1 %.not287, label %L87, label %L59

L59:                                              ; preds = %L54
  %60 = add i32 %58, 1
  %.not288 = icmp eq ptr addrspace(11) %25, null
  %61 = load i32, ptr addrspace(11) %25, align 4
  %62 = select i1 %.not288, i32 undef, i32 %61
  br label %L112

L87:                                              ; preds = %L54
  %63 = load i32, ptr addrspace(11) %25, align 4
  %64 = add i32 %63, 1
  %65 = load i32, ptr addrspace(11) %29, align 4
  %66 = icmp eq i32 %63, %65
  br i1 %66, label %common.ret, label %L112

L112:                                             ; preds = %L87, %L20, %L41, %L47, %L53, %L59
  %value_phi13336 = phi i32 [ %64, %L87 ], [ %62, %L59 ], [ %57, %L53 ], [ %50, %L47 ], [ %40, %L41 ], [ %20, %L20 ]
  %value_phi12335 = phi i32 [ 1, %L87 ], [ %60, %L59 ], [ %55, %L53 ], [ %48, %L47 ], [ %38, %L41 ], [ %18, %L20 ]
  %value_phi11334 = phi i32 [ 1, %L87 ], [ 1, %L59 ], [ %53, %L53 ], [ %46, %L47 ], [ %36, %L41 ], [ %16, %L20 ]
  %value_phi10333 = phi i32 [ 1, %L87 ], [ 1, %L59 ], [ 1, %L53 ], [ %44, %L47 ], [ %34, %L41 ], [ %14, %L20 ]
  %value_phi9332 = phi i32 [ 1, %L87 ], [ 1, %L59 ], [ 1, %L53 ], [ 1, %L47 ], [ %32, %L41 ], [ %12, %L20 ]
  %value_phi2326 = phi i32 [ 1, %L87 ], [ 1, %L59 ], [ 1, %L53 ], [ 1, %L47 ], [ 1, %L41 ], [ %5, %L20 ]
  %67 = getelementptr inbounds i8, ptr addrspace(11) %0, i32 24
  %68 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 24
  %69 = load i32, ptr addrspace(11) %68, align 4
  %70 = load i32, ptr addrspace(11) %67, align 4
  %.not289 = icmp eq i32 %69, %70
  br i1 %.not289, label %L134, label %L128

L128:                                             ; preds = %L112
  %71 = add i32 %69, 1
  %72 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 28
  %73 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 32
  %74 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 36
  %75 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 40
  %76 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 44
  %.not290 = icmp eq ptr addrspace(11) %72, null
  %77 = load i32, ptr addrspace(11) %72, align 4
  %78 = select i1 %.not290, i32 undef, i32 %77
  %.not291 = icmp eq ptr addrspace(11) %73, null
  %79 = load i32, ptr addrspace(11) %73, align 4
  %80 = select i1 %.not291, i32 undef, i32 %79
  %.not292 = icmp eq ptr addrspace(11) %74, null
  %81 = load i32, ptr addrspace(11) %74, align 4
  %82 = select i1 %.not292, i32 undef, i32 %81
  %.not293 = icmp eq ptr addrspace(11) %75, null
  %83 = load i32, ptr addrspace(11) %75, align 4
  %84 = select i1 %.not293, i32 undef, i32 %83
  %.not294 = icmp eq ptr addrspace(11) %76, null
  %85 = load i32, ptr addrspace(11) %76, align 4
  %86 = select i1 %.not294, i32 undef, i32 %85
  br label %L230

L134:                                             ; preds = %L112
  %87 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 28
  %88 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 32
  %89 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 36
  %90 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 40
  %91 = getelementptr inbounds i8, ptr addrspace(11) %1, i32 44
  %92 = getelementptr inbounds i8, ptr addrspace(11) %0, i32 28
  %93 = getelementptr inbounds i8, ptr addrspace(11) %0, i32 36
  %94 = getelementptr inbounds i8, ptr addrspace(11) %0, i32 40
  %95 = getelementptr inbounds i8, ptr addrspace(11) %0, i32 44
  %96 = load i32, ptr addrspace(11) %87, align 4
  %97 = load i32, ptr addrspace(11) %92, align 4
  %.not300 = icmp eq i32 %96, %97
  br i1 %.not300, label %L150, label %L149

L149:                                             ; preds = %L134
  %98 = add i32 %96, 1
  %.not301 = icmp eq ptr addrspace(11) %88, null
  %99 = load i32, ptr addrspace(11) %88, align 4
  %100 = select i1 %.not301, i32 undef, i32 %99
  %.not302 = icmp eq ptr addrspace(11) %89, null
  %101 = load i32, ptr addrspace(11) %89, align 4
  %102 = select i1 %.not302, i32 undef, i32 %101
  %.not303 = icmp eq ptr addrspace(11) %90, null
  %103 = load i32, ptr addrspace(11) %90, align 4
  %104 = select i1 %.not303, i32 undef, i32 %103
  %.not304 = icmp eq ptr addrspace(11) %91, null
  %105 = load i32, ptr addrspace(11) %91, align 4
  %106 = select i1 %.not304, i32 undef, i32 %105
  br label %L230

L150:                                             ; preds = %L134
  %107 = getelementptr inbounds i8, ptr addrspace(11) %0, i32 32
  %108 = load i32, ptr addrspace(11) %88, align 4
  %109 = load i32, ptr addrspace(11) %107, align 4
  %.not305 = icmp eq i32 %108, %109
  br i1 %.not305, label %L156, label %L155

L155:                                             ; preds = %L150
  %110 = add i32 %108, 1
  %.not306 = icmp eq ptr addrspace(11) %89, null
  %111 = load i32, ptr addrspace(11) %89, align 4
  %112 = select i1 %.not306, i32 undef, i32 %111
  %.not307 = icmp eq ptr addrspace(11) %90, null
  %113 = load i32, ptr addrspace(11) %90, align 4
  %114 = select i1 %.not307, i32 undef, i32 %113
  %.not308 = icmp eq ptr addrspace(11) %91, null
  %115 = load i32, ptr addrspace(11) %91, align 4
  %116 = select i1 %.not308, i32 undef, i32 %115
  br label %L230

L156:                                             ; preds = %L150
  %117 = load i32, ptr addrspace(11) %89, align 4
  %118 = load i32, ptr addrspace(11) %93, align 4
  %.not309 = icmp eq i32 %117, %118
  br i1 %.not309, label %L162, label %L161

L161:                                             ; preds = %L156
  %119 = add i32 %117, 1
  %.not310 = icmp eq ptr addrspace(11) %90, null
  %120 = load i32, ptr addrspace(11) %90, align 4
  %121 = select i1 %.not310, i32 undef, i32 %120
  %.not311 = icmp eq ptr addrspace(11) %91, null
  %122 = load i32, ptr addrspace(11) %91, align 4
  %123 = select i1 %.not311, i32 undef, i32 %122
  br label %L230

L162:                                             ; preds = %L156
  %124 = load i32, ptr addrspace(11) %90, align 4
  %125 = load i32, ptr addrspace(11) %94, align 4
  %.not312 = icmp eq i32 %124, %125
  br i1 %.not312, label %L195, label %L167

L167:                                             ; preds = %L162
  %126 = add i32 %124, 1
  %.not313 = icmp eq ptr addrspace(11) %91, null
  %127 = load i32, ptr addrspace(11) %91, align 4
  %128 = select i1 %.not313, i32 undef, i32 %127
  br label %L230

L195:                                             ; preds = %L162
  %129 = load i32, ptr addrspace(11) %91, align 4
  %130 = add i32 %129, 1
  %131 = load i32, ptr addrspace(11) %95, align 4
  %132 = icmp eq i32 %129, %131
  br i1 %132, label %common.ret, label %L230

common.ret:                                       ; preds = %L87, %L195, %L230
  %common.ret.op = phi { ptr addrspace(10), i8 } [ { ptr addrspace(10) null, i8 2 }, %L230 ], [ { ptr addrspace(10) null, i8 1 }, %L195 ], [ { ptr addrspace(10) null, i8 1 }, %L87 ]
  ret { ptr addrspace(10), i8 } %common.ret.op

L230:                                             ; preds = %L195, %L128, %L149, %L155, %L161, %L167
  %value_phi29359 = phi i32 [ %130, %L195 ], [ %128, %L167 ], [ %123, %L161 ], [ %116, %L155 ], [ %106, %L149 ], [ %86, %L128 ]
  %value_phi28358 = phi i32 [ 1, %L195 ], [ %126, %L167 ], [ %121, %L161 ], [ %114, %L155 ], [ %104, %L149 ], [ %84, %L128 ]
  %value_phi27357 = phi i32 [ 1, %L195 ], [ 1, %L167 ], [ %119, %L161 ], [ %112, %L155 ], [ %102, %L149 ], [ %82, %L128 ]
  %value_phi26356 = phi i32 [ 1, %L195 ], [ 1, %L167 ], [ 1, %L161 ], [ %110, %L155 ], [ %100, %L149 ], [ %80, %L128 ]
  %value_phi25355 = phi i32 [ 1, %L195 ], [ 1, %L167 ], [ 1, %L161 ], [ 1, %L155 ], [ %98, %L149 ], [ %78, %L128 ]
  %value_phi18349 = phi i32 [ 1, %L195 ], [ 1, %L167 ], [ 1, %L161 ], [ 1, %L155 ], [ 1, %L149 ], [ %71, %L128 ]
  store i32 %value_phi2326, ptr %union_bytes_return, align 4
  %.sroa.0429.sroa.0.sroa.2.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 4
  store i32 %value_phi9332, ptr %.sroa.0429.sroa.0.sroa.2.0.union_bytes_return.sroa_idx, align 4
  %.sroa.0429.sroa.0.sroa.3.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 8
  store i32 %value_phi10333, ptr %.sroa.0429.sroa.0.sroa.3.0.union_bytes_return.sroa_idx, align 4
  %.sroa.0429.sroa.0.sroa.4.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 12
  store i32 %value_phi11334, ptr %.sroa.0429.sroa.0.sroa.4.0.union_bytes_return.sroa_idx, align 4
  %.sroa.0429.sroa.0.sroa.5.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 16
  store i32 %value_phi12335, ptr %.sroa.0429.sroa.0.sroa.5.0.union_bytes_return.sroa_idx, align 4
  %.sroa.0429.sroa.0.sroa.6.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 20
  store i32 %value_phi13336, ptr %.sroa.0429.sroa.0.sroa.6.0.union_bytes_return.sroa_idx, align 4
  %.sroa.0429.sroa.2.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 24
  store i32 %value_phi18349, ptr %.sroa.0429.sroa.2.0.union_bytes_return.sroa_idx, align 4
  %.sroa.0429.sroa.3.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 28
  store i32 %value_phi25355, ptr %.sroa.0429.sroa.3.0.union_bytes_return.sroa_idx, align 4
  %.sroa.0429.sroa.4.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 32
  store i32 %value_phi26356, ptr %.sroa.0429.sroa.4.0.union_bytes_return.sroa_idx, align 4
  %.sroa.0429.sroa.5.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 36
  store i32 %value_phi27357, ptr %.sroa.0429.sroa.5.0.union_bytes_return.sroa_idx, align 4
  %.sroa.0429.sroa.6.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 40
  store i32 %value_phi28358, ptr %.sroa.0429.sroa.6.0.union_bytes_return.sroa_idx, align 4
  %.sroa.0429.sroa.7.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 44
  store i32 %value_phi29359, ptr %.sroa.0429.sroa.7.0.union_bytes_return.sroa_idx, align 4
  %.sroa.0429.sroa.8.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 48
  store i32 %value_phi2326, ptr %.sroa.0429.sroa.8.0.union_bytes_return.sroa_idx, align 4
  %.sroa.0429.sroa.8.sroa.2.0..sroa.0429.sroa.8.0.union_bytes_return.sroa_idx.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 52
  store i32 %value_phi9332, ptr %.sroa.0429.sroa.8.sroa.2.0..sroa.0429.sroa.8.0.union_bytes_return.sroa_idx.sroa_idx, align 4
  %.sroa.0429.sroa.8.sroa.3.0..sroa.0429.sroa.8.0.union_bytes_return.sroa_idx.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 56
  store i32 %value_phi10333, ptr %.sroa.0429.sroa.8.sroa.3.0..sroa.0429.sroa.8.0.union_bytes_return.sroa_idx.sroa_idx, align 4
  %.sroa.0429.sroa.8.sroa.4.0..sroa.0429.sroa.8.0.union_bytes_return.sroa_idx.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 60
  store i32 %value_phi11334, ptr %.sroa.0429.sroa.8.sroa.4.0..sroa.0429.sroa.8.0.union_bytes_return.sroa_idx.sroa_idx, align 4
  %.sroa.0429.sroa.8.sroa.5.0..sroa.0429.sroa.8.0.union_bytes_return.sroa_idx.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 64
  store i32 %value_phi12335, ptr %.sroa.0429.sroa.8.sroa.5.0..sroa.0429.sroa.8.0.union_bytes_return.sroa_idx.sroa_idx, align 4
  %.sroa.0429.sroa.8.sroa.6.0..sroa.0429.sroa.8.0.union_bytes_return.sroa_idx.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 68
  store i32 %value_phi13336, ptr %.sroa.0429.sroa.8.sroa.6.0..sroa.0429.sroa.8.0.union_bytes_return.sroa_idx.sroa_idx, align 4
  %.sroa.4430.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 72
  store i32 %value_phi18349, ptr %.sroa.4430.0.union_bytes_return.sroa_idx, align 4
  %.sroa.5431.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 76
  store i32 %value_phi25355, ptr %.sroa.5431.0.union_bytes_return.sroa_idx, align 4
  %.sroa.6432.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 80
  store i32 %value_phi26356, ptr %.sroa.6432.0.union_bytes_return.sroa_idx, align 4
  %.sroa.7433.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 84
  store i32 %value_phi27357, ptr %.sroa.7433.0.union_bytes_return.sroa_idx, align 4
  %.sroa.8434.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 88
  store i32 %value_phi28358, ptr %.sroa.8434.0.union_bytes_return.sroa_idx, align 4
  %.sroa.9435.0.union_bytes_return.sroa_idx = getelementptr inbounds i8, ptr %union_bytes_return, i32 92
  store i32 %value_phi29359, ptr %.sroa.9435.0.union_bytes_return.sroa_idx, align 4
  br label %common.ret
}

declare ptr @julia.get_pgcstack()

; Function Attrs: memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @julia.safepoint(ptr) #2

; Function Attrs: willreturn memory(argmem: read, inaccessiblemem: readwrite)
declare nonnull align 16 dereferenceable(16) ptr addrspace(10) @jl_alloc_genericmemory(ptr addrspace(10), i32) #3

; Function Attrs: nounwind willreturn allockind("alloc") allocsize(1) memory(argmem: read, inaccessiblemem: readwrite)
declare noalias nonnull ptr addrspace(10) @julia.gc_alloc_obj(ptr, i32, ptr addrspace(10)) #4

; Function Attrs: norecurse nosync nounwind speculatable willreturn memory(none)
declare noundef nonnull ptr addrspace(13) @julia.gc_loaded(ptr addrspace(10) nocapture noundef nonnull readnone, ptr noundef nonnull readnone) #5

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #6

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #6
```
gives error 
```
Instruction does not dominate all uses!
  %20 = shufflevector <4 x ptr addrspace(11)> %19, <4 x ptr addrspace(11)> poison, <4 x i32> zeroinitializer
  %17 = shufflevector <4 x ptr addrspace(11)> %20, <4 x ptr addrspace(11)> poison, <2 x i32> zeroinitializer
Instruction does not dominate all uses!
  %90 = shufflevector <4 x ptr addrspace(11)> %89, <4 x ptr addrspace(11)> poison, <4 x i32> zeroinitializer
  %87 = shufflevector <4 x ptr addrspace(11)> %90, <4 x ptr addrspace(11)> poison, <2 x i32> zeroinitializer
LLVM ERROR: Broken module found, compilation aborted!
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=slp-vectorizer <source>
1.	Running pass "verify" on module "<source>"
 #0 0x00000000050e6958 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x50e6958)
 #1 0x00000000050e434c SignalHandler(int) Signals.cpp:0:0
 #2 0x00007508e6a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007508e6a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007508e6a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007508e6a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00000000007d7105 llvm::json::operator==(llvm::json::Value const&, llvm::json::Value const&) (.cold) JSON.cpp:0:0
 #7 0x00000000050254d8 (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x50254d8)
 #8 0x0000000004f23440 llvm::VerifierPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x4f23440)
 #9 0x00000000009000ae 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+0x9000ae)
#10 0x0000000004ee6850 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x4ee6850)
#11 0x000000000090adda 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+0x90adda)
#12 0x00000000008fdd2a optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x8fdd2a)
#13 0x00007508e6a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#14 0x00007508e6a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#15 0x00000000008f57ae _start (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x8f57ae)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
https://godbolt.org/z/sah34KE77

Comments: author: Zentrik
body: Reduced IR:
```llvm
define swiftcc { ptr addrspace(10), i8 } @julia__zip_iterate_all_17381(ptr addrspace(11) %0, i32 %1) {
top:
  %2 = getelementptr i8, ptr addrspace(11) %0, i32 8
  %3 = getelementptr i8, ptr addrspace(11) %0, i32 12
  %4 = getelementptr i8, ptr addrspace(11) %0, i32 16
  %5 = getelementptr i8, ptr addrspace(11) %0, i32 20
  br i1 false, label %L42, label %L41

L41:                                              ; preds = %top
  %.not276 = icmp eq ptr addrspace(11) %2, null
  %6 = select i1 %.not276, i32 0, i32 0
  %.not277 = icmp eq ptr addrspace(11) %3, null
  %7 = select i1 %.not277, i32 0, i32 0
  %.not278 = icmp eq ptr addrspace(11) %4, null
  %8 = select i1 %.not278, i32 0, i32 0
  %.not279 = icmp eq ptr addrspace(11) %5, null
  %9 = select i1 %.not279, i32 0, i32 0
  br label %common.ret

L42:                                              ; preds = %top
  %.not282 = icmp eq ptr addrspace(11) %4, null
  %10 = select i1 %.not282, i32 0, i32 0
  %.not283 = icmp eq ptr addrspace(11) %5, null
  %11 = select i1 %.not283, i32 0, i32 0
  br label %common.ret

L59:                                              ; No predecessors!
  %12 = select i1 false, i32 0, i32 0
  br label %common.ret

common.ret:                                       ; preds = %L59, %L42, %L41
  %value_phi13336 = phi i32 [ %12, %L59 ], [ %11, %L42 ], [ %9, %L41 ]
  %value_phi12335 = phi i32 [ 0, %L59 ], [ %10, %L42 ], [ %8, %L41 ]
  %value_phi11334 = phi i32 [ 0, %L59 ], [ %1, %L42 ], [ %7, %L41 ]
  %value_phi10333 = phi i32 [ 0, %L59 ], [ 0, %L42 ], [ %6, %L41 ]
  ret { ptr addrspace(10), i8 } zeroinitializer
}
```
https://godbolt.org/z/a8xzqGYo9
author: Zentrik
body: Bisected to 69332bb8995aef60d830406de12cb79a5039026 and f3d2609af3031ddb54030548e86335f295cf49ca, @alexey-bataev 

Fix patch:
commit 7152bf3bc805b8d9b1873058ab0a084d7b6079d6
Author: Alexey Bataev <a.bataev@outlook.com>
Date:   Mon Oct 28 06:37:24 2024 -0700

    [SLP]Do not create new vector node if scalars fully overlap with the existing one
    
    If the list of scalars vectorized as the part of the same vector node,
    no need to generate vector node again, it will be handled as part of
    overlapping matching.
    
    Fixes #113810

diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 2afd02dae3a8..268546fe99e1 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -7947,8 +7947,13 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
           Nodes.insert(E);
         SmallPtrSet<Value *, 8> Values(VL.begin(), VL.end());
         if (any_of(Nodes, [&](const TreeEntry *E) {
-              return all_of(E->Scalars,
-                            [&](Value *V) { return Values.contains(V); });
+              if (all_of(E->Scalars,
+                         [&](Value *V) { return Values.contains(V); }))
+                return true;
+              SmallPtrSet<Value *, 8> EValues(E->Scalars.begin(),
+                                              E->Scalars.end());
+              return (
+                  all_of(VL, [&](Value *V) { return EValues.contains(V); }));
             })) {
           LLVM_DEBUG(dbgs() << "SLP: Gathering due to full overlap.\n");
           if (TryToFindDuplicates(S))


Regression tests:
file: llvm/test/Transforms/SLPVectorizer/full-overlap-non-schedulable.ll
commands: opt -S --passes=slp-vectorizer < %s
tests: test_name: test
test_body: define void @test(ptr %p1, ptr %0, i32 %1, i1 %c1, ptr %p2) {
top:
  %2 = getelementptr i8, ptr %0, i64 8
  %3 = getelementptr i8, ptr %0, i64 12
  %4 = getelementptr i8, ptr %0, i64 16
  %5 = getelementptr i8, ptr %0, i64 20
  br i1 %c1, label %L42, label %L41

L41:                                              ; preds = %top
  %.not276 = icmp eq ptr %2, null
  %6 = load i32, ptr %2, align 4
  %7 = select i1 %.not276, i32 0, i32 %6
  %.not277 = icmp eq ptr %3, null
  %8 = load i32, ptr %3, align 4
  %9 = select i1 %.not277, i32 0, i32 %8
  %.not278 = icmp eq ptr %4, null
  %10 = load i32, ptr %4, align 4
  %11 = select i1 %.not278, i32 0, i32 %10
  %.not279 = icmp eq ptr %5, null
  %12 = load i32, ptr %5, align 4
  %13 = select i1 %.not279, i32 0, i32 %12
  br label %L112

L42:                                              ; preds = %top
  %14 = load i32, ptr %2, align 4
  %.not280 = icmp eq i32 %14, 0
  br i1 %.not280, label %L112, label %L47

L47:                                              ; preds = %L42
  %15 = load i32, ptr %3, align 4
  %.not282 = icmp eq ptr %4, null
  %16 = load i32, ptr %4, align 4
  %17 = select i1 %.not282, i32 0, i32 %16
  %.not283 = icmp eq ptr %5, null
  %18 = load i32, ptr %5, align 4
  %19 = select i1 %.not283, i32 0, i32 %18
  br label %L112

L112:                                             ; preds = %L47, %L42, %L41
  %value_phi13336 = phi i32 [ %19, %L47 ], [ %13, %L41 ], [ 0, %L42 ]
  %value_phi12335 = phi i32 [ %17, %L47 ], [ %11, %L41 ], [ %1, %L42 ]
  %value_phi11334 = phi i32 [ %15, %L47 ], [ %9, %L41 ], [ 0, %L42 ]
  %value_phi10333 = phi i32 [ 0, %L47 ], [ %7, %L41 ], [ 0, %L42 ]
  store i32 %value_phi10333, ptr %p2, align 4
  store i32 %value_phi11334, ptr %p1, align 4
  store i32 %value_phi12335, ptr %p2, align 4
  store i32 %value_phi13336, ptr %p1, align 4
  ret void
}