projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4287d5e
)
Fold conditional branches on constants away.
author
Chris Lattner
<sabre@nondot.org>
Fri, 7 Jan 2005 22:49:57 +0000
(22:49 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Fri, 7 Jan 2005 22:49:57 +0000
(22:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19360
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
patch
|
blob
|
history
diff --git
a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 6ab1d4595755bbebbc0484185f9504811a2371ac..e917350f8c9709e573af31ff3938ff215fb76984 100644
(file)
--- a/
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/
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);