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

    <tr>
        <th>Summary</th>
        <td>
            [LoopVectorize][AArch64] Assertion `isValidElementType(ElementType) && "Element type of a VectorType must be an integer, floating point, or pointer type."' failed
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            vectorization
      </td>
    </tr>

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

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

<pre>
    This reduced IR:
```llvm
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-ni:1-p2:32:8:8:32-ni:2"
target triple = "aarch64-none-linux-gnu"


define void @test_crash() {
entry:
  br label %body

exit:                                          ; preds = %body
  ret void

body:                                           ; preds = %body, %entry
  %0 = phi i64 [ undef, %entry ], [ %3, %body ]
  %1 = phi i32 [ 2, %entry ], [ %4, %body ]
  %ares.i.2 = call i32 @llvm.fptosi.sat.i32.f32(float undef) ;#6
  %2 = add i64 %0, -23523
  store i64 %2, i64 addrspace(1)* undef, align 8
  %3 = add i64 %0, -31364
  store i64 %3, i64 addrspace(1)* undef, align 8
  %4 = add nuw nsw i32 %1, 1
  %5 = icmp ugt i32 %1, 363
  br i1 %5, label %exit, label %body
}

; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn
declare i32 @llvm.fptosi.sat.i32.f32(float) #1

attributes #1 = { nocallback nofree nosync nounwind readnone speculatable willreturn }
```
Triggers assertion in loop-vectorize:
```opt: /root/llvm-project/llvm/lib/IR/Type.cpp:688: static llvm::FixedVectorType* llvm::FixedVectorType::get(llvm::Type*, unsigned int): Assertion `isValidElementType(ElementType) && "Element type of a VectorType must " "be an integer, floating point, or " "pointer type."' failed.```

https://godbolt.org/z/KexqzEPP5
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1VVuv4yYQ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