Implement select.ll:test12*
authorChris Lattner <sabre@nondot.org>
Fri, 9 Apr 2004 23:46:01 +0000 (23:46 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 9 Apr 2004 23:46:01 +0000 (23:46 +0000)
commite576b91948ffb02562291fa02f1c84a457d5b6ba
tree96db0fe0fc48e49d83c1e8a086e0e161fc153f07
parenta5c5830d5330beeb8fe424c4cbe5f3758beb6938
Implement select.ll:test12*

This transforms code like this:

   %C = or %A, %B
   %D = select %cond, %C, %A
into:
   %C = select %cond, %B, 0
   %D = or %A, %C

Since B is often a constant, the select can often be eliminated.  In any case,
this reduces the usage count of A, allowing subsequent optimizations to happen.

This xform applies when the operator is any of:
  add, sub, mul, or, xor, and, shl, shr

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