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

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 21 06:20:24 PST 2023


benshi001 added inline comments.


================
Comment at: llvm/test/CodeGen/AVR/cmp.ll:232
+; CHECK-NEXT:    cpc  r25, r1
+; CHECK-NEXT:    brge
+;
----------------
`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:252
+; CHECK-NEXT:    cpc  r25, r19
+; CHECK-NEXT:    brge
+;
----------------
`x > 1023` is compiled to `x >= 1024`, the high byte is 4, and the low byte is represented via the zero register.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142281



More information about the llvm-commits mailing list