Swap the operands of a select node if the false (the second) operand is 0.
authorAkira Hatanaka <ahatanaka@mips.com>
Thu, 8 Mar 2012 02:14:24 +0000 (02:14 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Thu, 8 Mar 2012 02:14:24 +0000 (02:14 +0000)
commite2bdf7fc935008dda6fba3d6fdd0a12193fd7b18
tree5daacbfebbe8ea7d8df020f5fbdb9095d00f24f0
parent6f130bf368ab082ab87bafaee9bf4e1a78acc669
Swap the operands of a select node if the false (the second) operand is 0.

For example, this pattern
(select (setcc lhs, rhs, cc), true, 0)
is transformed to this one:
(select (setcc lhs, rhs, inverse(cc)), 0, true)

This enables MipsDAGToDAGISel::ReplaceUsesWithZeroReg (added in r152280) to
replace 0 with $zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152285 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsISelLowering.cpp