Port the fix for the select operator from instcombine's

ComputeNumSignBits to SelectionDAG's ComputeNumSignBits.

llvm-svn: 51348
This commit is contained in:
Dan Gohman 2008-05-20 20:59:51 +00:00
parent 287e750e64
commit d545f5b229

View File

@ -1690,9 +1690,9 @@ unsigned SelectionDAG::ComputeNumSignBits(SDOperand Op, unsigned Depth) const{
return std::min(Tmp, Tmp2);
case ISD::SELECT:
Tmp = ComputeNumSignBits(Op.getOperand(0), Depth+1);
Tmp = ComputeNumSignBits(Op.getOperand(1), Depth+1);
if (Tmp == 1) return 1; // Early out.
Tmp2 = ComputeNumSignBits(Op.getOperand(1), Depth+1);
Tmp2 = ComputeNumSignBits(Op.getOperand(2), Depth+1);
return std::min(Tmp, Tmp2);
case ISD::SETCC: