[llvm] [AArch64] Take cmn into account when adjusting compare constants (PR #98634)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 12 10:33:38 PDT 2024


================
@@ -107,11 +107,11 @@ define i32 @overflow_add_const_limit(i8 zeroext %a, i8 zeroext %b) {
 define i32 @overflow_add_positive_const_limit(i8 zeroext %a) {
 ; CHECK-LABEL: overflow_add_positive_const_limit:
 ; CHECK:       // %bb.0:
-; CHECK-NEXT:    mov w8, #-1 // =0xffffffff
-; CHECK-NEXT:    mov w9, #8 // =0x8
-; CHECK-NEXT:    cmp w8, w0, sxtb
+; CHECK-NEXT:    sxtb w9, w0
----------------
AtariDreams wrote:

The mindset is that by moving the negative to be a constant, we could avoid having movs, and if that mov can be replaced by splitting out the sxtb instruction, that's still less work. 

https://github.com/llvm/llvm-project/pull/98634


More information about the llvm-commits mailing list