[DAGCombiner] PCMP* sets its result to all ones or zeros so we can AND with the
authorQuentin Colombet <qcolombet@apple.com>
Fri, 21 Feb 2014 23:42:41 +0000 (23:42 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Fri, 21 Feb 2014 23:42:41 +0000 (23:42 +0000)
commit0206b30ea6ca3cdd04d968ca676ccb025ef75158
tree23ef37e7ee095f63edc3588bac4958e2385a0327
parent94f20bfe6e9de6a1c80c7bfe2dc77202c88847b4
[DAGCombiner] PCMP* sets its result to all ones or zeros so we can AND with the
shifted mask rather than masking and shifting separately.

The patch adds this transformation to the DAGCombiner:

  (shl (and (setcc:i8v16 ...) N01C) N1C) -> (and (setcc:i8v16 ...) N01C<<N1C)

<rdar://problem/16054492>

Patch by Adam Nemet <anemet@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201906 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/shift-pcmp.ll [new file with mode: 0644]