summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-06-24 15:04:11 +0000
committerDan Gohman <gohman@apple.com>2010-06-24 15:04:11 +0000
commitdf6b33e77887ca1f70275718bf4abd50daad9501 (patch)
treec35c37e04085da5015cb8fe6f69858ef760beac5 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent218f5541b2598f82821a89524c52857207b21584 (diff)
downloadbcm5719-llvm-df6b33e77887ca1f70275718bf4abd50daad9501.tar.gz
bcm5719-llvm-df6b33e77887ca1f70275718bf4abd50daad9501.zip
Eliminate the first have of the optimization which eliminates BRCOND
when the condition is constant. This optimization shouldn't be necessary, because codegen shouldn't be able to find dead control paths that the IR-level optimizer can't find. And it's undesirable, because it encourages bugpoint to leave "br i1 false" branches in its output. And it wasn't updating the CFG. I updated all the tests I could, but some tests are too reduced and I wasn't able to meaningfully preserve them. llvm-svn: 106748
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 4cbfaed87fc..5719cefb42e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -3047,9 +3047,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT,
break;
case ISD::BRCOND:
if (N2C) {
- if (N2C->getZExtValue()) // Unconditional branch
- return getNode(ISD::BR, DL, MVT::Other, N1, N3);
- else
+ if (!N2C->getZExtValue()) // Unconditional branch
return N1; // Never-taken branch
}
break;
OpenPOWER on IntegriCloud