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

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 11:39:22 PDT 2016


spatel retitled this revision from "[x86, ppc] prefer comparisons against zero for and+cmp sequences" to "[x86] prefer comparisons against zero for and+cmp sequences".
spatel updated the summary for this revision.
spatel updated this revision to Diff 56314.
spatel added a comment.

Patch updated:

1. Move the transform to the DAG vs. the earlier rev that was based in CGP. It turns out that the 'power-of-2' scenario is already handled for us here; TargetLowering has a function called valueHasExactlyOneBitSet() that is used in SimplifySetCC().

2. I removed the PPC diffs for simplicity, but my local testing shows the same benefits as the earlier rev of the patch.

3. I'm not sure if this transform should live in TargetLowering, but I've made it a helper of SimplifySetCC() in this draft because that's where all of the related transforms are. DAGCombiner::visitSETCC() calls DAGCombiner::SimplifySetCC() calls TargetLowering::SimplifySetCC(). It's not clear to me what the trade-offs would be if we added transforms directly to DAGCombiner::visitSETCC().


http://reviews.llvm.org/D19087

Files:
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/SelectionDAG/TargetLowering.cpp
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  test/CodeGen/X86/bmi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19087.56314.patch
Type: text/x-patch
Size: 7571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160505/9fe6fbf2/attachment.bin>


More information about the llvm-commits mailing list