[PATCH] D35340: [x86] use more shift or LEA for select-of-constants

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 10:09:06 PDT 2017


spatel updated this revision to Diff 110421.
spatel added a comment.

Patch updated:
As shown in PR34097 ( https://bugs.llvm.org/show_bug.cgi?id=34097 ), I failed to account for the subtract overflow case, so add a check for that.

Ideally, we'll update this all to use xor/and+add for all constants and avoid that issue (mul+add is really only here because that matches to LEA). For now, this is still the smallest code and codegen diff, so I think it's best to go with that and make sure I haven't introduced any other bugs.


https://reviews.llvm.org/D35340

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/2010-08-04-MaskedSignedCompare.ll
  test/CodeGen/X86/memcmp-optsize.ll
  test/CodeGen/X86/memcmp.ll
  test/CodeGen/X86/merge-consecutive-stores.ll
  test/CodeGen/X86/mul-constant-result.ll
  test/CodeGen/X86/pr22338.ll
  test/CodeGen/X86/sbb.ll
  test/CodeGen/X86/select.ll
  test/CodeGen/X86/select_const.ll
  test/CodeGen/X86/sext-i1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35340.110421.patch
Type: text/x-patch
Size: 29252 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170809/093b229b/attachment.bin>


More information about the llvm-commits mailing list