[PATCH] D25999: LegalizeDAG: Implement expansion of f16 = FP_TO_FP16 f64

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 09:40:38 PDT 2016


tstellarAMD updated this revision to Diff 76435.
tstellarAMD added a comment.

Move the expansion into the AMDGPU backend.

I wanted to implement this as a target independent expansion, however when
targets say they want to expand FP_TO_FP16 what they actually want is
the unsafe math expansion when possible and expansion to a libcall in all
other cases.

      

The only way to make this work as a target independent would be to add logic
to target's TargetLowering construction to mark theses nodes as Expand when
LegalizeDAG can use the unsafe expansion and mark them as LibCall when it
cannot.  I think this would be possible, but I think it would be too fragile
and complex as it would require targets to keep their expansion logic up
to date with the code in LegalizeDAG.


https://reviews.llvm.org/D25999

Files:
  lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  lib/Target/AMDGPU/AMDGPUISelLowering.h
  test/CodeGen/AMDGPU/fptrunc.ll
  test/CodeGen/AMDGPU/trunc-store-f64-to-f16.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25999.76435.patch
Type: text/x-patch
Size: 9328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161031/38470283/attachment.bin>


More information about the llvm-commits mailing list