Teach DAGCombiner how to canonicalize dags according to the rule
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 25 Sep 2013 19:01:01 +0000 (19:01 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 25 Sep 2013 19:01:01 +0000 (19:01 +0000)
commit2ce3ac8dd8c8e43f0a1a4db1a11f452b087ca24d
treeb0c12bd05f2e2f49c3a49dad30aa5048a383776d
parent070156437752179833b1e5fddd50caa03fd7c12f
Teach DAGCombiner how to canonicalize dags according to the rule
 (shl (zext (shr A, X)), X) => (zext (shl (shr A, X), X)).

The rule only triggers when there are no other uses of the
zext to avoid materializing more instructions.

This helps the DAGCombiner understand that the shl/shr
sequence can then be converted into an and instruction.

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