[PATCH] D84166: AMDGPU: Simplify f16 to i64 custom lowering

Petar Avramovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 21 07:59:40 PDT 2020


Petar.Avramovic updated this revision to Diff 279522.
Petar.Avramovic added a comment.

This update also simplifies f16 -> i64 on subtargets without has16BitInsts().
Such targets immediately promote f16 to f32 whenever they encounter f16 def using fp16_to_fp node. Recognize fp16_to_fp input to f32 to i64 and do the same thing as for f16 to i64 conversion. This gives similar(small difference for f16 vectors) results for subtargets with or without has16BitInsts() since f16->i32 gets selected like f16->f32->i32.
Update tests with more detailed checks.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84166/new/

https://reviews.llvm.org/D84166

Files:
  llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  llvm/test/CodeGen/AMDGPU/fptosi.f16.ll
  llvm/test/CodeGen/AMDGPU/fptoui.f16.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84166.279522.patch
Type: text/x-patch
Size: 5630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200721/14675a81/attachment-0001.bin>


More information about the llvm-commits mailing list