[PATCH] D14496: X86: More efficient codegen for 64-bit compares on 32-bit target

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 12 03:13:29 PST 2015


hans retitled this revision from "X86: More efficient codegen for 64-bit compare-and-branch
" to "X86: More efficient codegen for 64-bit compares on 32-bit target
".
hans updated the summary for this revision.
hans updated this revision to Diff 40020.
hans added a comment.

Here is a new version of the patch, using the SUB-SBB method.

I'm trying a new approach, adding a custom SETCC_PARTS node. This avoids the trouble of pattern-matching, allows this to fire in more situations (e.g. not just branches, but all setcc's), and would makes it easier to do the same thing for other targets.

I did try to come up with a way to make this more generic, using ISD::SUBC and SUBE, but couldn't figure out how to detect the outcome based on the result from SUBE. For unsigned comparisons we can just compare it against zero (a comparison that will get folded away nicely), but what to do for unsigned?

I've removed the change to equality comparisons. It might still be worth looking at some more since it lowers the register pressure (maybe use when optimizing for size?).


http://reviews.llvm.org/D14496

Files:
  include/llvm/CodeGen/ISDOpcodes.h
  lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  test/CodeGen/X86/2012-08-17-legalizer-crash.ll
  test/CodeGen/X86/atomic-minmax-i6432.ll
  test/CodeGen/X86/atomic128.ll
  test/CodeGen/X86/avx512-cmp.ll
  test/CodeGen/X86/wide-integer-cmp.ll
  test/CodeGen/X86/win32-pic-jumptable.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14496.40020.patch
Type: text/x-patch
Size: 14516 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151112/662a1ce6/attachment.bin>


More information about the llvm-commits mailing list