diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-01-07 22:49:57 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-01-07 22:49:57 +0000 |
| commit | 5c66e45b9218fc9abbcbffcc81a8f04365ae4d50 (patch) | |
| tree | 1c4aa360d480ee9496b2d6b071c5b9747adac471 | |
| parent | cda3efa6e514d2ae499617c506723d082f5cd7b0 (diff) | |
| download | bcm5719-llvm-5c66e45b9218fc9abbcbffcc81a8f04365ae4d50.tar.gz bcm5719-llvm-5c66e45b9218fc9abbcbffcc81a8f04365ae4d50.zip | |
Fold conditional branches on constants away.
llvm-svn: 19360
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 6ab1d459575..e917350f8c9 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -727,6 +727,12 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, } 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); |

