[PATCH] D120219: [X86] Canonicalize SGT/UGT compares with constants for JCC to use SGE/UGE to reduce the number of EFLAGs reads.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 20 13:22:55 PST 2022


RKSimon created this revision.
RKSimon added reviewers: spatel, pengfei, craig.topper, lebedev.ri, dblaikie, nemanjai, Yi-Hong.Lyu.
Herald added subscribers: hiraditya, qcolombet.
RKSimon requested review of this revision.
Herald added a project: LLVM.

This extends D101074 <https://reviews.llvm.org/D101074> so the SGT/UGT -> SGE/UGE canonicalization is used for conditional jumps as well as conditional moves and comparison results.

As discussed on PR48760, some EFLAG bits are treated independently which can require additional uops to merge together for certain Jcc cases.

I'm uncertain on how/whether to deal with the use-cr-result-of-dom-icmp-st.ll regressions, its not clear to me that this the "-cgp-icmp-eq2icmp-st flag" is actually enabled anywhere, and I get the impression that D60506 <https://reviews.llvm.org/D60506> was principally a PPC combine that was made generic.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120219

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/2006-10-10-FindModifiedNodeSlotBug.ll
  llvm/test/CodeGen/X86/2006-11-17-IllegalMove.ll
  llvm/test/CodeGen/X86/2008-04-17-CoalescerBug.ll
  llvm/test/CodeGen/X86/2009-08-12-badswitch.ll
  llvm/test/CodeGen/X86/avx512-broadcast-unfold.ll
  llvm/test/CodeGen/X86/extend-set-cc-uses-dbg.ll
  llvm/test/CodeGen/X86/loop-blocks.ll
  llvm/test/CodeGen/X86/loop-strength-reduce7.ll
  llvm/test/CodeGen/X86/machine-cse.ll
  llvm/test/CodeGen/X86/mul-constant-result.ll
  llvm/test/CodeGen/X86/optimize-max-0.ll
  llvm/test/CodeGen/X86/pr38217.ll
  llvm/test/CodeGen/X86/pr38795.ll
  llvm/test/CodeGen/X86/ragreedy-hoist-spill.ll
  llvm/test/CodeGen/X86/reverse_branches.ll
  llvm/test/CodeGen/X86/sibcall.ll
  llvm/test/CodeGen/X86/speculative-execution-side-effect-suppression.ll
  llvm/test/CodeGen/X86/speculative-load-hardening-indirect.ll
  llvm/test/CodeGen/X86/switch-bt.ll
  llvm/test/CodeGen/X86/switch-density.ll
  llvm/test/CodeGen/X86/switch-lower-peel-top-case.ll
  llvm/test/CodeGen/X86/switch-zextload.ll
  llvm/test/CodeGen/X86/switch.ll
  llvm/test/CodeGen/X86/tail-dup-multiple-latch-loop.ll
  llvm/test/CodeGen/X86/tail-merge-unreachable.ll
  llvm/test/CodeGen/X86/tail-threshold.ll
  llvm/test/CodeGen/X86/twoaddr-lea.ll
  llvm/test/CodeGen/X86/use-cr-result-of-dom-icmp-st.ll
  llvm/test/CodeGen/X86/vector-shift-by-select-loop.ll
  llvm/test/CodeGen/X86/widen_cast-1.ll
  llvm/test/CodeGen/X86/widen_cast-2.ll
  llvm/test/CodeGen/X86/x32-va_start.ll
  llvm/test/CodeGen/X86/x86-shrink-wrapping.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120219.410181.patch
Type: text/x-patch
Size: 54262 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220220/dd02f103/attachment.bin>


More information about the llvm-commits mailing list