[PATCH] D113107: Support of expression granularity for _Float16.

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 22 20:02:48 PDT 2022

pengfei added a comment.

> Supporting the lowering in the backend is sensible in order to support -fexcess-precision=16, because I agree that the most reasonable IR output in that configuration is to simply generate half operations. But under -fexcess-precision=32, I do not want the frontend to be in the business of recognizing cases where promoted emission is unnecessary, because that is just a lot of extra complexity for something that's already fairly special-case logic; among other things, it will tend to hide bugs.

Fair enough. I agree we should choose the easy way to go. Thanks for the explanation!

> So I think we should hold off on adding this option until we know what behavior we actually want to expose via it.

I don't have strong opinion on the specific `-fexcess-precision` option, but we do need an option to stop the promotion in the FE. Some user requires the emulation to gets the identical result as running on real HW. How about we make `EmitFloat16WithExcessPrecision` an Clang option and set it true by default and false for feature `avx512fp16`?



More information about the cfe-commits mailing list