[amdgpu] Improve the from f32 to i64.
authorMichael Liao <michael.hliao@gmail.com>
Fri, 11 Jun 2021 21:21:09 +0000 (17:21 -0400)
committerMichael Liao <michael.hliao@gmail.com>
Sat, 19 Jun 2021 16:46:48 +0000 (12:46 -0400)
commit940efa4f6981964c95a69ff412378722438607bf
treecfefed274710839cbac84e618056fe318434ac5c
parent328b21a3389cf04e50bf9fb7b295c1d6af6f60d3
[amdgpu] Improve the from f32 to i64.

- Take the same principle as the conversion from f64 to i64 with extra
  necessary pre- and post-processing. It helps to reduce that conversion
  sequence by half compared to legacy one.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D104427
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fptosi.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fptoui.mir
llvm/test/CodeGen/AMDGPU/fp_to_sint.ll
llvm/test/CodeGen/AMDGPU/fp_to_uint.ll