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

    <tr>
        <th>Summary</th>
        <td>
            [NVPTX][bfloat] vector load support:`Cannot select: t27: bf16 = extract_vector_elt t18, Constant:i64<1>`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            bug,
            backend:NVPTX
      </td>
    </tr>

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

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

<pre>
    The NVPTX backend is lacking `bfloat` support for even basic stuff.

For instance, given the following IR:
```llvm
target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64"
target triple = "nvptx64-nvidia-cuda"

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
define void @foo(ptr noalias readonly align 16 %arg, ptr noalias align 16 %arg1) local_unnamed_addr #0 {
bb:
  %i = addrspacecast ptr %arg1 to ptr addrspace(1)
  %i2 = addrspacecast ptr %arg to ptr addrspace(1)
  %i11 = load <4 x bfloat>, ptr addrspace(1) %i2, align 4
  store <4 x bfloat> %i11, ptr addrspace(1) %i, align 8
  ret void
}

attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!nvvm.annotations = !{!0, !1, !2, !3}

!0 = !{ptr @foo, !"kernel", i32 1}
!1 = !{ptr @foo, !"maxntidx", i32 64}
!2 = !{ptr @foo, !"maxntidy", i32 1}
!3 = !{ptr @foo, !"maxntidz", i32 1}
```

Compiled with:
```
llc -o - <in>.ll -mcpu=sm_80
```

The backend will crash with:
```
LLVM ERROR: Cannot select: t27: bf16 = extract_vector_elt t18, Constant:i64<1>
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8Vd9v4ygQ_m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