<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63436>63436</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[NVPTX] Instruction selection failures for NVPTXISD::LoadV2 in presence of different source destination types
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nirvedhmeshram
</td>
</tr>
</table>
<pre>
In this llvm IR
```
define void @foo(ptr noalias readonly align 16 %0, ptr noalias readonly align 16 %1) {
%3 = getelementptr half, ptr %0, i64 0
%4 = load <8 x half>, ptr %3, align 16
%5 = fpext <8 x half> %4 to <8 x float>
store <8 x float> %5, ptr %1, align 16
ret void
}
!nvvm.annotations = !{!0}
!0 = !{ptr @foo, !"kernel", i32 1}
```
running with `bin/llc -march=nvptx -mcpu=sm_80 --debug` will gt the following failure
https://gist.github.com/nirvedhmeshram/59912f126126f00a22920b770c330782
However, if you remove the nvvm.annotation this will work, so my first question is, is it by design that we dont want to use this code for addrspace 1?
https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp#L1071-L1085
because then tis hitting this part
https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp#L1599-L1622
which is not meant to handle the NVPTXISD::LoadV nodes so we can extend its handling if that is the right thing to do?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVU2P2zYQ_TX0ZWCDH7JsHXzYrOp0gUVRtIugt4ISRxIbilRJyl7_-4KUNnE2AYqeChgQTc17M_PejC1D0L1FPJH9B7KvN3KOg_Mnq_0F1TBiGLwcN41Tt9OThTjoAMZcRnj6jdCa0AdS0vWTvyrstEW4OK2AFLRzjvDjFD1YJ42WATxK5ay5gTS6t8BKIHxPCX-Ef41ihFdADh_WxHwvgIgaeoxocEQbE8MgTffG9sasywLoF1SRU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