[Bug][ARM] vcvt_{s,u} NEON builtins lowered as plain fptosi/fptoui instead of saturating intrinsics
Open
backend:ARM
miscompilation
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
ARM NEON intrinsics for FP-Int conversion are being lowered into non-saturating casts, but later selected as saturating instructions. However, if we have an optimization that uses UB for cast overflow case, we end up producing a different code.
Here is a small example of such a miscompile:
https://godbolt.org/z/f6cn17EoM
Running it produces 0 for -O0 and 251 for -O2. gcc correctly does not perform this optimization.
Contributor guide
Assessment
This issue has not been assessed yet.