OSDN Git Service

This patch enables SimplifyUsingDistributiveLaws() to handle following pattens.
authorDinesh Dwivedi <dinesh.d@samsung.com>
Tue, 26 Aug 2014 08:53:32 +0000 (08:53 +0000)
committerDinesh Dwivedi <dinesh.d@samsung.com>
Tue, 26 Aug 2014 08:53:32 +0000 (08:53 +0000)
commit52c92df181fc25f3f6cf4789142376e82e7240d7
tree9651543e23bc9d96964d98152325fd05cfb3d61e
parent647d329db39df735086db546cc05cfe8708095a7
This patch enables SimplifyUsingDistributiveLaws() to handle following pattens.

(X >> Z) & (Y >> Z)  -> (X&Y) >> Z  for all shifts.
(X >> Z) | (Y >> Z)  -> (X|Y) >> Z  for all shifts.
(X >> Z) ^ (Y >> Z)  -> (X^Y) >> Z  for all shifts.

These patterns were previously handled separately in visitAnd()/visitOr()/visitXor().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216443 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
lib/Transforms/InstCombine/InstructionCombining.cpp