diff options
author | Momchil Velikov <momchil.velikov@arm.com> | 2025-01-24 10:57:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-24 10:57:23 +0000 |
commit | dac49e8ddd5dc0104c238f09cdd532e6fb5c4f1d (patch) | |
tree | 17b8606ebfa50d4e957506378ee7c7e9c2e81d85 /llvm/lib/Transforms/Utils/InlineFunction.cpp | |
parent | 8e702735090388a3231a863e343f880d0f96fecb (diff) | |
download | llvm-dac49e8ddd5dc0104c238f09cdd532e6fb5c4f1d.zip llvm-dac49e8ddd5dc0104c238f09cdd532e6fb5c4f1d.tar.gz llvm-dac49e8ddd5dc0104c238f09cdd532e6fb5c4f1d.tar.bz2 |
[Arm] Fix generating code with UB in NeonEmitter (#121802)
When generating `arm_neon.h`, NeonEmitter outputs code that
violates strict aliasing rules (C23 6.5 Expressions #7,
C++23 7.2.1 Value category [basic.lval] #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`.
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
0 files changed, 0 insertions, 0 deletions