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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 17 06:07:11 PDT 2021


RKSimon updated this revision to Diff 352693.
RKSimon edited the summary of this revision.
RKSimon added a comment.

Use APInt::isMinValue() for consistency

Added fold for select(seteq(X,Y),A,select(setgt(X,Y), A, B)) -> select(setge(X,Y), A, B) folds for SETCC after type legalization - this could be added separately if required.

This just leaves a few regressions where we create 2 64-bit constants instead of 1


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101074

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/2008-09-11-CoalescerBug2.ll
  llvm/test/CodeGen/X86/atomic-eflags-reuse.ll
  llvm/test/CodeGen/X86/cmov.ll
  llvm/test/CodeGen/X86/cmp.ll
  llvm/test/CodeGen/X86/codegen-prepare-uaddo.ll
  llvm/test/CodeGen/X86/ctpop-combine.ll
  llvm/test/CodeGen/X86/dagcombine-select.ll
  llvm/test/CodeGen/X86/lack-of-signed-truncation-check.ll
  llvm/test/CodeGen/X86/mul-constant-result.ll
  llvm/test/CodeGen/X86/omit-urem-of-power-of-two-or-zero-when-comparing-with-zero.ll
  llvm/test/CodeGen/X86/or-branch.ll
  llvm/test/CodeGen/X86/pr34080-2.ll
  llvm/test/CodeGen/X86/pr45995-2.ll
  llvm/test/CodeGen/X86/pr5145.ll
  llvm/test/CodeGen/X86/sadd_sat.ll
  llvm/test/CodeGen/X86/sadd_sat_plus.ll
  llvm/test/CodeGen/X86/sat-add.ll
  llvm/test/CodeGen/X86/sdiv_fix_sat.ll
  llvm/test/CodeGen/X86/select.ll
  llvm/test/CodeGen/X86/select_const.ll
  llvm/test/CodeGen/X86/setcc-logic.ll
  llvm/test/CodeGen/X86/setcc-lowering.ll
  llvm/test/CodeGen/X86/setcc.ll
  llvm/test/CodeGen/X86/shift-i128.ll
  llvm/test/CodeGen/X86/signed-truncation-check.ll
  llvm/test/CodeGen/X86/smul_fix_sat.ll
  llvm/test/CodeGen/X86/smul_fix_sat_constants.ll
  llvm/test/CodeGen/X86/srem-seteq-illegal-types.ll
  llvm/test/CodeGen/X86/srem-seteq-optsize.ll
  llvm/test/CodeGen/X86/srem-seteq.ll
  llvm/test/CodeGen/X86/ssub_sat.ll
  llvm/test/CodeGen/X86/ssub_sat_plus.ll
  llvm/test/CodeGen/X86/uadd_sat.ll
  llvm/test/CodeGen/X86/uadd_sat_plus.ll
  llvm/test/CodeGen/X86/udiv_fix_sat.ll
  llvm/test/CodeGen/X86/umul_fix_sat.ll
  llvm/test/CodeGen/X86/urem-seteq-illegal-types.ll
  llvm/test/CodeGen/X86/urem-seteq-nonzero.ll
  llvm/test/CodeGen/X86/urem-seteq-optsize.ll
  llvm/test/CodeGen/X86/urem-seteq.ll
  llvm/test/CodeGen/X86/use-cr-result-of-dom-icmp-st.ll
  llvm/test/CodeGen/X86/vector-mulfix-legalize.ll
  llvm/test/CodeGen/X86/zext-sext.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101074.352693.patch
Type: text/x-patch
Size: 162753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210617/4b4aad70/attachment-0001.bin>


More information about the llvm-commits mailing list