rjmccall added a comment.

I'm not sure what optimization you mean.  Because the ABI returns 16-bit and 
32-bit FP values differently, there really isn't a way that we can return a 
value without going through a truncation/extension cycle.  There's potential to 
eliminate those with IPO, but we should definitely leave that for a different 
patch, for two reasons:

- first, because this patch is already quite involved, and we should strive to 
do the work incrementally; and
- second, because that use of IPO would be substantially controversial, because 
optimization levels would change computation results.

Also, leaking promoted values out of normal emission isn't how we would do that 
optimization.  We'd make the emission of returns call EmitPromoted and then 
emit some special pattern to turn a float into an fp16 return value, and we'd 
make the emission of calls within EmitPromoted emit some special pattern to 
turn an fp16 return value into a float, and then we'd make e.g. the inliner 
recognize and eliminate those special patterns when they matched up over a call 
boundary.


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

https://reviews.llvm.org/D113107

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to