[all-commits] [llvm/llvm-project] c19e90: [AArch64] Signed comparison using CMN is safe when...
AZero13 via All-commits
all-commits at lists.llvm.org
Thu Jun 12 13:03:12 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c19e900ce8b422f6b8c028fbbd9ef7e9d3720236
https://github.com/llvm/llvm-project/commit/c19e900ce8b422f6b8c028fbbd9ef7e9d3720236
Author: AZero13 <gfunni234 at gmail.com>
Date: 2025-06-12 (Thu, 12 Jun 2025)
Changed paths:
M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
M llvm/test/CodeGen/AArch64/cmp-to-cmn.ll
Log Message:
-----------
[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.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list