aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-07 08:19:42 +0000
committerChris Lattner <sabre@nondot.org>2005-01-07 08:19:42 +0000
commitc18ae4cb6a263cf31283c0ef51ace24350f8d72b (patch)
tree3626289090adfa0dce9c612eab29677fb1d84d08
parent186fcf696408bef3fd4159fd55ec19a68dcd1a82 (diff)
downloadexternal_llvm-c18ae4cb6a263cf31283c0ef51ace24350f8d72b.zip
external_llvm-c18ae4cb6a263cf31283c0ef51ace24350f8d72b.tar.gz
external_llvm-c18ae4cb6a263cf31283c0ef51ace24350f8d72b.tar.bz2
Teach legalize how to handle condbranches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19339 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 748ad3f..c8369aa 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -305,6 +305,16 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
}
break;
+ case ISD::BRCOND:
+ Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
+ // FIXME: booleans might not be legal!
+ Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the condition.
+ // Basic block destination (Op#2) is always legal.
+ if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1))
+ Result = DAG.getNode(ISD::BRCOND, MVT::Other, Tmp1, Tmp2,
+ Node->getOperand(2));
+ break;
+
case ISD::LOAD:
Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the pointer.