[PATCH] D142281: [AVR] Optimize 16-bit comparison with a constant

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 5 18:01:34 PST 2023


benshi001 added inline comments.


================
Comment at: llvm/test/CodeGen/AVR/cmp.ll:243
+; CHECK-NEXT:    cpi r24, 127
+; CHECK-NEXT:    cpc r25, r1
+; CHECK-NEXT:    brge .LBB12_2
----------------
x > 126 is compiled to x >= 127, the low byte value is 127, and the high byte valued zero is represented via the zero register.


================
Comment at: llvm/test/CodeGen/AVR/cmp.ll:289
+; TINY-NEXT:    cp r24, r17
+; TINY-NEXT:    cpc r25, r21
+; TINY-NEXT:    brge .LBB13_2
----------------
x > 1023 is compiled to x >= 1024, the high byte is 4, and the low byte is represented via the zero register.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142281/new/

https://reviews.llvm.org/D142281



More information about the llvm-commits mailing list