OSDN Git Service

[X86] Add an override of targetShrinkDemandedConstant to limit the damage that shrink...
authorCraig Topper <craig.topper@intel.com>
Sat, 20 Jan 2018 18:50:09 +0000 (18:50 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 20 Jan 2018 18:50:09 +0000 (18:50 +0000)
commit10fbe29b938b76b617645c9b525531f6a6aa9908
tree6d0db1abe0ca495c1671dd62a864541d2689773b
parentf91a07274585be0d46bd79ec1a95deeaf966cae5
[X86] Add an override of targetShrinkDemandedConstant to limit the damage that shrinkdemandedbits can do to zext_in_reg operations

Summary:
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 D42088 ended up removing during isel.

Reviewers: spatel, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D42265

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323048 91177308-0d34-0410-b5e6-96231b3b80d8
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
test/CodeGen/X86/zext-demanded.ll