1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Fold conditional branches on constants away.

llvm-svn: 19360
This commit is contained in:
Chris Lattner 2005-01-07 22:49:57 +00:00
parent 8f55fae569
commit 53173ba1d1

View File

@ -727,6 +727,12 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
} }
break; break;
case ISD::BRCOND:
if (N2C)
if (N2C->getValue()) // Unconditional branch
return getNode(ISD::BR, MVT::Other, N1, N3);
else
return N1; // Never-taken branch
} }
SDNode *N = new SDNode(Opcode, N1, N2, N3); SDNode *N = new SDNode(Opcode, N1, N2, N3);