[clang] [Clang][CodeGen] Loose the cast check when emitting builtins (PR #81669)

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 14 06:51:23 PST 2024


shiltian wrote:

> Don't see how that could be related; you can losslessly bitconvert between i16 and bfloat

Yes, `canLosslesslyBitCastTo` doesn't allow cast between `i16` and `bfloat`, but it does between two vectors, as long as their sizes are the same.

> A cast between float and int sounds like "re-interpretation of the bits" to me. Though the function already allows it if it's a vector of int/float.

Yeah. I was reluctant to allow it in `canLosslesslyBitCastTo` also because of that. Since it allows vector conversion, it already breaks the purpose.


https://github.com/llvm/llvm-project/pull/81669


More information about the cfe-commits mailing list