[PATCH] D101074: [X86] Canonicalize SGT/UGT compares with constants to use SGE/UGE to reduce the number of EFLAGs reads. (PR48760)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 29 06:25:38 PDT 2021


RKSimon added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:23481
+      const APInt &Op1Val = Op1C->getAPIntValue();
+      if (!Op1Val.isNullValue() && Op1Val.isSignedIntN(32)) {
+        // Ensure the constant+1 doesn't overflow.
----------------
lebedev.ri wrote:
> Actually, what about: `-2147483649` is i33, incremented it is `-2147483648`, i32.
Sorry - missed this when I was getting back to speed - I'll add a test


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