[PATCH] D42265: [X86] Add an override of targetShrinkDemandedConstant to limit the damage that shrinkdemandedbits can do to zext_in_reg operations

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 15:11:07 PST 2018


craig.topper created this revision.
craig.topper added reviewers: spatel, RKSimon.

This patch adds an implementation of targetShrinkDemandedConstant that tries to keep shrinkdemandedbits from removing bits that would otherwise have been recognized as a movzx.

We still need a follow patch to stop moving ands across srl if the and could be represented as a movzx before the shift but not after. I think this should help with some of the cases that https://reviews.llvm.org/D42088 ended up removing during isel.


https://reviews.llvm.org/D42265

Files:
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  lib/Target/X86/X86InstrCompiler.td
  test/CodeGen/X86/3addr-or.ll
  test/CodeGen/X86/popcnt.ll
  test/CodeGen/X86/pr21792.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42265.130499.patch
Type: text/x-patch
Size: 7425 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180118/1ec94171/attachment.bin>


More information about the llvm-commits mailing list