AMDGPU/GlobalISel: Legalize s16->s64 G_FPTOSI/G_FPTOUI
authorPetar Avramovic <Petar.Avramovic@amd.com>
Mon, 20 Jul 2020 09:04:30 +0000 (11:04 +0200)
committerPetar Avramovic <Petar.Avramovic@amd.com>
Mon, 20 Jul 2020 09:06:11 +0000 (11:06 +0200)
commitba938f6388ffa632b3781416b7734e0d97cee245
treefe5d85ea28130c64c1e2f48fb3076a28202da439
parent2a4df6a3250870910176eae8f0c2b199c6a8cdde
AMDGPU/GlobalISel: Legalize s16->s64 G_FPTOSI/G_FPTOUI

Add narrowScalarFor action.
Add narrow scalar for typeIndex == 0 for G_FPTOSI/G_FPTOUI.
Legalize using narrowScalarFor as s16->s32 G_FPTOSI/G_FPTOUI
followed by s32->s64 G_SEXT/G_ZEXT.

Differential Revision: https://reviews.llvm.org/D84010
llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fptosi.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fptoui.mir