[PATCH] D113107: Support of expression granularity for _Float16.
John McCall via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 23 11:58:35 PDT 2022
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
More information about the llvm-commits
mailing list