[PATCH] D101074: [X86] Canonicalize LT/GT compares with constants to use LE/GE to reduce the number of EFLAGs reads. (PR48760)

Pengfei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 17 07:09:39 PDT 2021


pengfei added inline comments.


================
Comment at: llvm/test/CodeGen/X86/lack-of-signed-truncation-check.ll:601
 ; X86-NEXT:    addl $8, %eax
-; X86-NEXT:    cmpw $15, %ax
-; X86-NEXT:    seta %al
+; X86-NEXT:    cmpw $16, %ax
+; X86-NEXT:    setae %al
----------------
RKSimon wrote:
> pengfei wrote:
> > Is it possible that we happen to exceed IMM16?
> No - we check for min/max values before decrementing/incrementing to ensure we don't wrap the value.
I just saw you check int8 and int32. But I cannot create a case for the int16 boundary value due to its promoted to int32.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101074



More information about the llvm-commits mailing list