OSDN Git Service

[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)
commit0428e2f20575be2fcc025fddbd8abb72ce6cd515
tree55fc34f7a18880d786baae32cfd1ac0874697f78
parent02d9cc1a8ee6c15ffeb561276c22e387764de0fb
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358805 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelDAGToDAG.cpp
test/CodeGen/X86/narrow-shl-cst.ll