Commit 3c6f05b
authored
AMDGPU: Make v2f32 -> v2f16 legal when target supports v_cvt_pk_f16_f32 (llvm#139956) (llvm#2186)
If targets support v_cvt_pk_f16_f32 instruction, v2f32 -> v2f16 should
be legal. However, SelectionDAG does not allow us to specify the source
type in the legalization rules. To workaround this, we make FP_ROUND
Custom for v2f16 then set up v2f32 -> v2f16 to be legal during custom
lowering.
Fixes: SWDEV-532608 -- expected v_cvt_pk_f16_f32 was not generated.
Cherry-pick f01f082 from upstreaam to mainline.1 parent 1ce493a commit 3c6f05b
File tree
2 files changed
+26
-2
lines changed- llvm
- lib/Target/AMDGPU
- test/CodeGen/AMDGPU
2 files changed
+26
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
907 | 907 | | |
908 | 908 | | |
909 | 909 | | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
910 | 913 | | |
911 | 914 | | |
912 | 915 | | |
| |||
6696 | 6699 | | |
6697 | 6700 | | |
6698 | 6701 | | |
| 6702 | + | |
| 6703 | + | |
| 6704 | + | |
| 6705 | + | |
| 6706 | + | |
| 6707 | + | |
| 6708 | + | |
| 6709 | + | |
| 6710 | + | |
6699 | 6711 | | |
6700 | 6712 | | |
6701 | 6713 | | |
6702 | | - | |
6703 | | - | |
6704 | 6714 | | |
6705 | 6715 | | |
6706 | 6716 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
15 | 29 | | |
16 | 30 | | |
17 | 31 | | |
| |||
0 commit comments