Bug type: crash
Component: LoopVectorize
Bug location: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp: LoopVectorizationPlanner::cost
Issue title: Assertion `VF.Width == BestVF && "VPlan cost model and legacy cost model disagreed"' failed.
Labels: vectorizers
crash
Reported by: TatyanaDoubts

To reproduce run opt with 
```
-passes=loop-vectorize --mcpu=skylake-avx512 --mattr=+prfchw,-cldemote,+avx,+aes,+sahf,+pclmul,-xop,+crc32,+xsaves,-avx512fp16,-usermsr,-sm4,-egpr,+sse4.1,-avx512ifma,+xsave,+sse4.2,-tsxldtrk,-sm3,-ptwrite,-widekl,+invpcid,+64bit,+xsavec,-avx10.1-512,-avx512vpopcntdq,+cmov,-avx512vp2intersect,+avx512cd,+movbe,-avxvnniint8,-ccmp,-amx-int8,-kl,-avx10.1-256,+evex512,-avxvnni,+rtm,+adx,+avx2,-hreset,-movdiri,-serialize,-sha512,-vpclmulqdq,+avx512vl,-uintr,-cf,+clflushopt,-raoint,-cmpccxadd,+bmi,-amx-tile,+sse,-gfni,-avxvnniint16,-amx-fp16,-zu,-ndd,+xsaveopt,+rdrnd,+avx512f,-amx-bf16,-avx512bf16,-avx512vnni,-push2pop2,+cx8,+avx512bw,+sse3,+pku,-nf,+fsgsbase,-clzero,-mwaitx,-lwp,+lzcnt,-sha,-movdir64b,-ppx,-wbnoinvd,-enqcmd,-avxneconvert,-tbm,-pconfig,-amx-complex,+ssse3,+cx16,+bmi2,+fma,+popcnt,-avxifma,+f16c,-avx512bitalg,-rdpru,+clwb,+mmx,+sse2,+rdseed,-avx512vbmi2,-prefetchi,-rdpid,-fma4,-avx512vbmi,-shstk,-vaes,-waitpkg,-sgx,+fxsr,+avx512dq,-sse4a,-avx512f
```
with the following test:
```
; 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:
  %mul = mul i32 %arg, 3
  %zext = zext i32 %arg to i64
  br label %bb1

bb1:                                              ; preds = %bb1, %bb
  %phi = phi i64 [ %add, %bb1 ], [ 4, %bb ]
  %phi2 = phi i32 [ %trunc, %bb1 ], [ %mul, %bb ]
  %getelementptr = getelementptr i32, ptr addrspace(1) null, i64 %phi
  %and = and i32 %phi2, 0
  store i32 0, ptr addrspace(1) %getelementptr, align 4
  %mul3 = mul i64 %phi, %zext
  %add = add i64 %phi, 1
  %icmp = icmp ugt i64 %phi, 65
  %trunc = trunc i64 %mul3 to i32
  br i1 %icmp, label %bb4, label %bb1

bb4:                                              ; preds = %bb1
  ret void
}
```
Reproducer:  https://godbolt.org/z/nPsP7h51n

Stack dump:
```
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/opt -o /app/output.s -S -passes=loop-vectorize --mcpu=skylake-avx512 --mattr=+prfchw,-cldemote,+avx,+aes,+sahf,+pclmul,-xop,+crc32,+xsaves,-avx512fp16,-usermsr,-sm4,-egpr,+sse4.1,-avx512ifma,+xsave,+sse4.2,-tsxldtrk,-sm3,-ptwrite,-widekl,+invpcid,+64bit,+xsavec,-avx10.1-512,-avx512vpopcntdq,+cmov,-avx512vp2intersect,+avx512cd,+movbe,-avxvnniint8,-ccmp,-amx-int8,-kl,-avx10.1-256,+evex512,-avxvnni,+rtm,+adx,+avx2,-hreset,-movdiri,-serialize,-sha512,-vpclmulqdq,+avx512vl,-uintr,-cf,+clflushopt,-raoint,-cmpccxadd,+bmi,-amx-tile,+sse,-gfni,-avxvnniint16,-amx-fp16,-zu,-ndd,+xsaveopt,+rdrnd,+avx512f,-amx-bf16,-avx512bf16,-avx512vnni,-push2pop2,+cx8,+avx512bw,+sse3,+pku,-nf,+fsgsbase,-clzero,-mwaitx,-lwp,+lzcnt,-sha,-movdir64b,-ppx,-wbnoinvd,-enqcmd,-avxneconvert,-tbm,-pconfig,-amx-complex,+ssse3,+cx16,+bmi2,+fma,+popcnt,-avxifma,+f16c,-avx512bitalg,-rdpru,+clwb,+mmx,+sse2,+rdseed,-avx512vbmi2,-prefetchi,-rdpid,-fma4,-avx512vbmi,-shstk,-vaes,-waitpkg,-sgx,+fxsr,+avx512dq,-sse4a,-avx512f <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 "wombat"
 #0 0x0000000004f053c8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x4f053c8)
 #1 0x0000000004f02b3c SignalHandler(int) Signals.cpp:0:0
 #2 0x00007458cc042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007458cc0969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007458cc042476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007458cc0287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00007458cc02871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x00007458cc039e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x0000000003f83f37 llvm::LoopVectorizePass::processLoop(llvm::Loop*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3f83f37)
 #9 0x0000000003f86659 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*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3f86659)
#10 0x0000000003f86cd2 llvm::LoopVectorizePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3f86cd2)
#11 0x0000000002e596ce 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+0x2e596ce)
#12 0x0000000004d02758 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x4d02758)
#13 0x0000000000de089e 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+0xde089e)
#14 0x0000000004d0114e llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x4d0114e)
#15 0x0000000000de0eee 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+0xde0eee)
#16 0x0000000004cff2b0 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x4cff2b0)
#17 0x00000000008e3752 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+0x8e3752)
#18 0x00000000008d667c optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x8d667c)
#19 0x00007458cc029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#20 0x00007458cc029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#21 0x00000000008cdade _start (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x8cdade)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```

Comments: author: patrick-rivos
body: Potentially related: https://github.com/llvm/llvm-project/issues/100591

Fix patch:
commit cd08fadd03904806fa26a1f117879ddae34fbf67
Author: Florian Hahn <flo@fhahn.com>
Date:   Mon Aug 12 14:45:43 2024 +0100

    [LV] Include chains feeding inductions in cost precomputation.
    
    Include chain of ops feeding inductions in cost precomputation for
    inductions, not just the induction increment. In VPlan, those
    instructions will be cleaned up, as both phi and increment are generated
    by VPWidenIntOrFpInductionRecipe independently.
    
    Fixes https://github.com/llvm/llvm-project/issues/101337.

diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 542d74ef0e1e..41e4b0fcd9b0 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -7080,7 +7080,16 @@ InstructionCost LoopVectorizationPlanner::cost(VPlan &Plan,
   for (const auto &[IV, IndDesc] : Legal->getInductionVars()) {
     Instruction *IVInc = cast<Instruction>(
         IV->getIncomingValueForBlock(OrigLoop->getLoopLatch()));
-    SmallVector<Instruction *> IVInsts = {IV, IVInc};
+    SmallVector<Instruction *> IVInsts = {IVInc};
+    for (unsigned I = 0; I != IVInsts.size(); I++) {
+      for (Value *Op : IVInsts[I]->operands()) {
+        auto *OpI = dyn_cast<Instruction>(Op);
+        if (Op == IV || !OpI || !OrigLoop->contains(OpI) || !Op->hasOneUse())
+          continue;
+        IVInsts.push_back(OpI);
+      }
+    }
+    IVInsts.push_back(IV);
     for (User *U : IV->users()) {
       auto *CI = cast<Instruction>(U);
       if (!CostCtx.CM.isOptimizableIVTruncate(CI, VF))


Regression tests:
file: llvm/test/Transforms/LoopVectorize/X86/induction-costs.ll
commands: opt -p loop-vectorize -mtriple=x86_64-apple-macosx -S %s
tests: test_name: iv_and_step_trunc
test_body: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"

define i16 @iv_and_step_trunc() {
entry:
  br label %loop

loop:                                             ; preds = %loop, %entry
  %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
  %rec = phi i16 [ 0, %entry ], [ %rec.next, %loop ]
  %iv.next = add i64 %iv, 1
  %0 = trunc i64 %iv to i16
  %1 = trunc i64 %iv.next to i16
  %rec.next = mul i16 %0, %1
  %ec = icmp eq i64 %iv, 1
  br i1 %ec, label %exit, label %loop

exit:                                             ; preds = %loop
  ret i16 %rec
}

test_name: wombat2
test_body: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"

define void @wombat2(i32 %arg, ptr %dst) #0 {
entry:
  %mul = mul i32 %arg, 3
  %zext = zext i32 %arg to i64
  br label %loop

loop:                                             ; preds = %loop, %entry
  %phi = phi i64 [ 4, %entry ], [ %add, %loop ]
  %phi2 = phi i32 [ %mul, %entry ], [ %trunc.1, %loop ]
  %getelementptr = getelementptr i32, ptr %dst, i64 %phi
  %and = and i32 %phi2, 12
  store i32 %and, ptr %getelementptr, align 4
  %mul3 = mul i64 %phi, %zext
  %add = add i64 %phi, 1
  %icmp = icmp ugt i64 %phi, 65
  %trunc.0 = trunc i64 %mul3 to i60
  %trunc.1 = trunc i60 %trunc.0 to i32
  br i1 %icmp, label %exit, label %loop

exit:                                             ; preds = %loop
  ret void
}

attributes #0 = { "target-cpu"="skylake-avx512" "target-features"="-avx512f" }

test_name: with_dead_use
test_body: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"

define void @with_dead_use(i32 %arg, ptr %dst) #0 {
entry:
  %mul = mul i32 %arg, 3
  %zext = zext i32 %arg to i64
  br label %loop

loop:                                             ; preds = %loop, %entry
  %phi = phi i64 [ 4, %entry ], [ %add, %loop ]
  %phi2 = phi i32 [ %mul, %entry ], [ %trunc, %loop ]
  %getelementptr = getelementptr i32, ptr %dst, i64 %phi
  %and = and i32 %phi2, 12
  store i32 %and, ptr %getelementptr, align 4
  %mul3 = mul i64 %phi, %zext
  %add = add i64 %phi, 1
  %icmp = icmp ugt i64 %phi, 65
  %trunc = trunc i64 %mul3 to i32
  %dead.and = and i32 %trunc, 123
  br i1 %icmp, label %exit, label %loop

exit:                                             ; preds = %loop
  ret void
}

attributes #0 = { "target-cpu"="skylake-avx512" "target-features"="-avx512f" }

test_name: test_scalar_predicated_cost
test_body: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"

define i32 @test_scalar_predicated_cost(i64 %x, i64 %y, ptr %A) #0 {
entry:
  br label %loop.header

loop.header:                                      ; preds = %loop.latch, %entry
  %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ]
  %cmp9.not = icmp ule i64 %iv, %y
  br i1 %cmp9.not, label %loop.latch, label %if.then

if.then:                                          ; preds = %loop.header
  %or = or i64 %x, %iv
  %gep = getelementptr i32, ptr %A, i64 %iv
  %t = trunc i64 %or to i32
  store i32 %t, ptr %gep, align 4
  br label %loop.latch

loop.latch:                                       ; preds = %if.then, %loop.header
  %iv.next = add i64 %iv, 1
  %ec = icmp eq i64 %iv, 100
  br i1 %ec, label %exit, label %loop.header

exit:                                             ; preds = %loop.latch
  ret i32 0
}

attributes #0 = { "min-legal-vector-width"="0" "target-cpu"="skylake-avx512" }

test_name: truncated_ivs_with_wide_and_scalar_uses
test_body: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"

define void @truncated_ivs_with_wide_and_scalar_uses(i1 %c, ptr %dst) {
entry:
  br label %loop

loop:                                             ; preds = %loop, %entry
  %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
  %iv.16 = trunc i64 %iv to i16
  %iv.32 = trunc i64 %iv to i32
  %gep = getelementptr i16, ptr %dst, i32 %iv.32
  %sel = select i1 %c, i16 %iv.16, i16 10
  store i16 %sel, ptr %gep, align 2
  %iv.next = add i64 %iv, 1
  %ec = icmp eq i64 %iv, 64
  br i1 %ec, label %exit, label %loop

exit:                                             ; preds = %loop
  ret void
}

test_name: multiple_truncated_ivs_with_wide_uses
test_body: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"

define void @multiple_truncated_ivs_with_wide_uses(i1 %c, ptr %A, ptr %B) {
entry:
  br label %loop

loop:                                             ; preds = %loop, %entry
  %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
  %iv.16 = trunc i64 %iv to i16
  %iv.32 = trunc i64 %iv to i32
  %sel = select i1 %c, i16 %iv.16, i16 10
  %gep.A = getelementptr i16, ptr %A, i64 %iv
  store i16 %sel, ptr %gep.A, align 2
  %gep.B = getelementptr i32, ptr %B, i64 %iv
  store i32 %iv.32, ptr %gep.B, align 4
  %iv.next = add i64 %iv, 1
  %ec = icmp eq i64 %iv, 64
  br i1 %ec, label %exit, label %loop

exit:                                             ; preds = %loop
  ret void
}

test_name: wide_iv_trunc_reuse
test_body: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"

define void @wide_iv_trunc_reuse(ptr %dst) {
entry:
  br label %loop

loop:                                             ; preds = %loop, %entry
  %iv = phi i64 [ 1, %entry ], [ %iv.next, %loop ]
  %iv.2 = phi i32 [ 0, %entry ], [ %iv.trunc, %loop ]
  store i32 %iv.2, ptr %dst, align 4
  %iv.next = add i64 %iv, 1
  %ec = icmp eq i64 %iv, 0
  %iv.trunc = trunc i64 %iv to i32
  br i1 %ec, label %exit, label %loop

exit:                                             ; preds = %loop
  ret void
}

test_name: iv_used_widened_and_truncated
test_body: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"

define i32 @iv_used_widened_and_truncated(ptr %dst, i64 %N) #0 {
entry:
  br label %loop

loop:                                             ; preds = %loop, %entry
  %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
  %gep = getelementptr { i32, [8 x i32] }, ptr %dst, i64 %iv
  %t = trunc i64 %iv to i32
  store i32 %t, ptr %gep, align 8
  %iv.next = add i64 %iv, 1
  %c = icmp eq i64 %iv, %N
  br i1 %c, label %exit, label %loop

exit:                                             ; preds = %loop
  ret i32 0
}

attributes #0 = { "min-legal-vector-width"="0" "target-cpu"="skylake-avx512" }

test_name: wombat
test_body: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"

define void @wombat(i32 %arg, ptr %dst) #0 {
entry:
  %mul = mul i32 %arg, 3
  %zext = zext i32 %arg to i64
  br label %loop

loop:                                             ; preds = %loop, %entry
  %phi = phi i64 [ 4, %entry ], [ %add, %loop ]
  %phi2 = phi i32 [ %mul, %entry ], [ %trunc, %loop ]
  %getelementptr = getelementptr i32, ptr %dst, i64 %phi
  %and = and i32 %phi2, 12
  store i32 %and, ptr %getelementptr, align 4
  %mul3 = mul i64 %phi, %zext
  %add = add i64 %phi, 1
  %icmp = icmp ugt i64 %phi, 65
  %trunc = trunc i64 %mul3 to i32
  br i1 %icmp, label %exit, label %loop

exit:                                             ; preds = %loop
  ret void
}

attributes #0 = { "target-cpu"="skylake-avx512" "target-features"="-avx512f" }

test_name: wide_iv_trunc
test_body: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"

define void @wide_iv_trunc(ptr %dst, i64 %N) {
entry:
  %cmp = icmp ult i64 %N, 8
  br i1 %cmp, label %loop, label %exit

loop:                                             ; preds = %loop, %entry
  %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
  %iv.trunc = trunc i64 %iv to i32
  store i32 %iv.trunc, ptr %dst, align 4
  %iv.next = add i64 %iv, 1
  %ec = icmp eq i64 %iv, %N
  br i1 %ec, label %exit, label %loop

exit:                                             ; preds = %loop, %entry
  ret void
}

test_name: multiple_pointer_ivs_with_scalar_uses_only
test_body: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"

define void @multiple_pointer_ivs_with_scalar_uses_only(ptr %A, ptr %B) #0 {
entry:
  br label %loop

loop:                                             ; preds = %loop, %entry
  %iv.1 = phi i32 [ 100, %entry ], [ %dec, %loop ]
  %iv.2 = phi i32 [ 2048, %entry ], [ %add38, %loop ]
  %ptr.iv.1 = phi ptr [ %A, %entry ], [ %outptr.0, %loop ]
  %ptr.iv.2 = phi ptr [ %B, %entry ], [ %incdec.ptr36, %loop ]
  %ptr.iv.3 = phi ptr [ %B, %entry ], [ %incdec.ptr33, %loop ]
  %incdec.ptr33 = getelementptr i8, ptr %ptr.iv.3, i64 1
  %0 = load i8, ptr %ptr.iv.3, align 1
  %conv34 = zext i8 %0 to i32
  %incdec.ptr36 = getelementptr i8, ptr %ptr.iv.2, i64 1
  %1 = load i8, ptr %ptr.iv.2, align 1
  %conv37 = zext i8 %1 to i32
  %add38 = add i32 %conv34, %conv37
  %shr42 = lshr i32 %iv.2, 1
  %conv43 = trunc i32 %shr42 to i8
  store i8 %conv43, ptr %ptr.iv.1, align 1
  %dec = add i32 %iv.1, 1
  %outptr.0 = getelementptr i8, ptr %ptr.iv.1, i64 2
  %cmp30.not = icmp eq i32 %dec, 0
  br i1 %cmp30.not, label %exit, label %loop

exit:                                             ; preds = %loop
  ret void
}

attributes #0 = { "min-legal-vector-width"="0" "target-cpu"="skylake-avx512" }