This is an archive of the discontinued LLVM Phabricator instance.

DAG: Constant fold fp16_to_fp/fp16_to_fp
ClosedPublic

Authored by arsenm on Jan 13 2017, 1:12 PM.

Details

Summary

This fixes emitting conversions of constants on targets
without legal f16 that need to use these for legalization.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 84360.Jan 13 2017, 1:12 PM
arsenm retitled this revision from to DAG: Constant fold fp16_to_fp/fp16_to_fp.
arsenm updated this object.
arsenm added a reviewer: bogner.
arsenm added a subscriber: llvm-commits.
arsenm updated this revision to Diff 84384.Jan 13 2017, 2:20 PM
arsenm edited edge metadata.

Fix other ARM run lines

RKSimon added a subscriber: RKSimon.
RKSimon added inline comments.
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
3335

Add ISD::FP_TO_FP16: to vector constant folding?

arsenm added inline comments.Jan 24 2017, 2:06 PM
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
3335

I'm not sure these support vectors?

3335

The intrinsics do not, but I guess it could differ for the node

arsenm added inline comments.Jan 24 2017, 9:12 PM
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
3335

The intrinsics are turned into the normal FP casts instructions, so this only matters for targets using these for legalization purposes. It looks like only AMDGPU is doing this now, so I have no vector use/way to test it

RKSimon accepted this revision.Jan 26 2017, 5:38 AM

LGTM - How come we haven't been able to remove these intrinsics and just use (f32 fpext(f16 bitcast(i16 src))) style patterns?

lib/CodeGen/SelectionDAG/SelectionDAG.cpp
3335

Sorry I was getting this mixed up with basic fpext/fptrunc half handling.

This revision is now accepted and ready to land.Jan 26 2017, 5:38 AM

LGTM - How come we haven't been able to remove these intrinsics and just use (f32 fpext(f16 bitcast(i16 src))) style patterns?

Not sure. I think we could even autoupgrade these, though the nodes are still handy for targets without legal f16

arsenm closed this revision.Jan 30 2017, 9:09 AM

r293499