[X86] Widen the 'AND' mask if doing so shrinks the encoding size
authorDavid Majnemer <david.majnemer@gmail.com>
Sun, 16 Aug 2015 04:52:11 +0000 (04:52 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sun, 16 Aug 2015 04:52:11 +0000 (04:52 +0000)
commit7e9986fa34a97b6d7ae4102de57baa9f0b7b0e0f
treeee5f692dfabb22d18653c316fccc98b367166664
parent00225dcc223cccbfe8d7ae5d1f35b843c1e55f73
[X86] Widen the 'AND' mask if doing so shrinks the encoding size

We can set additional bits in a mask given that we know the other
operand of an AND already has some bits set to zero.  This can be more
efficient if doing so allows us to use an instruction which implicitly
sign extends the immediate.

This fixes PR24085.

Differential Revision: http://reviews.llvm.org/D11289

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245169 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelDAGToDAG.cpp
test/CodeGen/X86/shift-pair.ll
test/CodeGen/X86/win64_frame.ll
test/CodeGen/X86/zext-fold.ll