[X86] Using (SUB32ri GR32:$src1, -128) for (add X, 128) incorrectly preserves NUW flag
Open
backend:X86
miscompilation
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
If the ADD instruction has an NUW flag, it is incorrectly copied into the MIR SUB instructions. If any MIR transforms use this flag, they may get incorrect information.
There are many such patterns like this with the same issue.
CC: @rksimon @phoebewang @arsenm
Contributor guide
Assessment
This issue has not been assessed yet.