Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Arm] Fix generating code with UB in NeonEmitter (llvm#121802)
When generating `arm_neon.h`, NeonEmitter outputs code that violates strict aliasing rules (C23 6.5 Expressions rust-lang#7, C++23 7.2.1 Value category [basic.lval] rust-lang#11), for example: bfloat16_t __reint = __p0; uint32_t __reint1 = (uint32_t)(*(uint16_t *) &__reint) << 16; __ret = *(float32_t *) &__reint1; This patch fixed the offending code by replacing it with a call to `__builtin_bit_cast`.
- Loading branch information