[X86] Don't turn (and (shl X, C1), C2) into (shl (and X, (C1 >> C2), C2) if the origi...
authorCraig Topper <craig.topper@intel.com>
Sat, 20 Apr 2019 04:38:53 +0000 (04:38 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 20 Apr 2019 04:38:53 +0000 (04:38 +0000)
commit4d4b5d952e4587d320fa94db5bce783a915d03ee
tree3d1c75312d2bf77ba2d8a64a1f39a88f92e00c21
parent8b8264828cbc4de633dfce90a7185c52a83687dc
[X86] Don't turn (and (shl X, C1), C2) into (shl (and X, (C1 >> C2), C2) if the original AND can represented by MOVZX.

The MOVZX doesn't require an immediate to be encoded at all. Though it does use
a 2 byte opcode so its the same size as a 1 byte immediate. But it has a
separate source and dest register so can help avoid copies.

llvm-svn: 358805
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/test/CodeGen/X86/narrow-shl-cst.ll