[llvm] [AArch64] Take cmn into account when adjusting compare constants (PR #98634)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 12 10:14:07 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
----------------
david-arm wrote:
I wonder if this is this any better in terms of performance? It's the same number of instructions, but the change seems to have introduced slightly more register dependence. Previously we had two rematerialisable constants, i.e. `mov w8, #-1` and `mov w9, #8` that had more flexibility in being scheduled. However, the new code only has one - `mov w9, #8`.
https://github.com/llvm/llvm-project/pull/98634
More information about the llvm-commits
mailing list