[PATCH] D19087: [x86, ppc] prefer comparisons against zero for and+cmp sequences

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 17:25:15 PDT 2016


spatel created this revision.
spatel added reviewers: hfinkel, andreadb, kbsmith1.
spatel added a subscriber: llvm-commits.
Herald added subscribers: mcrosier, jyknight, aemerson.

This patch started life for x86 first, hence there are more tests there, but I think that at least PPC, ARM, AArch64, and Sparc probably want to do this too, so I added PPC to make sure the TLI hook was strong enough to support another target.

I had forgotten that PPC actually has a full assortment of logic ops as instructions (orc, nand), so we might want to generalize the hook and pattern recognition in CGP some more, but I think that could be a follow-up.

If this looks reasonable, I can split the target-specific changes into separate commits. Note that http://reviews.llvm.org/D18842 would cause this transform to trigger more often.

For reference, this relates to:
https://llvm.org/bugs/show_bug.cgi?id=27105
https://llvm.org/bugs/show_bug.cgi?id=27202
https://llvm.org/bugs/show_bug.cgi?id=27203
https://llvm.org/bugs/show_bug.cgi?id=27328

http://reviews.llvm.org/D19087

Files:
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/CodeGenPrepare.cpp
  lib/Target/PowerPC/PPCISelLowering.cpp
  lib/Target/PowerPC/PPCISelLowering.h
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  test/CodeGen/PowerPC/andc.ll
  test/CodeGen/X86/bmi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19087.53644.patch
Type: text/x-patch
Size: 11544 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160414/bbb2eed8/attachment.bin>


More information about the llvm-commits mailing list