llvm-project
c19e900c - [AArch64] Signed comparison using CMN is safe when the subtraction is nsw (#141993)

Commit
111 days ago
[AArch64] Signed comparison using CMN is safe when the subtraction is nsw (#141993) nsw means no signed wrap, and 0 - INT_MIN is a signed wrap. Now, this is going to be a point I need to get out of the way: So is it okay to always transform a > -b into cmn if it is a signed comparison, even if b is INT_MIN because -INT_MIN is undefined, at least in C, because unless fwrapv is specified, opt puts nsw on signed integer operations, allowing for more folds anyway.
Author
Parents
Loading