[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Nate Begeman
natebegeman at mac.com
Tue Aug 16 12:49:47 PDT 2005
Changes in directory llvm/include/llvm/CodeGen:
SelectionDAG.h updated: 1.37 -> 1.38
SelectionDAGNodes.h updated: 1.49 -> 1.50
---
Log message:
Implement BR_CC and BRTWOWAY_CC. This allows the removal of a rather nasty
fixme from the PowerPC backend. Emit slightly better code for legalizing
select_cc.
---
Diffs of the changes: (+27 -0)
SelectionDAG.h | 15 +++++++++++++++
SelectionDAGNodes.h | 12 ++++++++++++
2 files changed, 27 insertions(+)
Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.37 llvm/include/llvm/CodeGen/SelectionDAG.h:1.38
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.37 Tue Aug 16 13:16:24 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h Tue Aug 16 14:49:34 2005
@@ -193,6 +193,21 @@
return getNode(ISD::SELECT_CC, VT, LHS, RHS, True, False,getCondCode(Cond));
}
+ /// getBR2Way_CC - Helper function to make it easier to build BRTWOWAY_CC
+ /// nodes.
+ ///
+ SDOperand getBR2Way_CC(SDOperand Chain, SDOperand CCNode, SDOperand LHS,
+ SDOperand RHS, SDOperand True, SDOperand False) {
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Chain);
+ Ops.push_back(CCNode);
+ Ops.push_back(LHS);
+ Ops.push_back(RHS);
+ Ops.push_back(True);
+ Ops.push_back(False);
+ return getNode(ISD::BRTWOWAY_CC, MVT::Other, Ops);
+ }
+
/// getLoad - Loads are not normal binary operators: their result type is not
/// determined by their operands, and they produce a value AND a token chain.
///
Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.49 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.50
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.49 Tue Aug 16 13:32:18 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Tue Aug 16 14:49:34 2005
@@ -233,6 +233,18 @@
// operation to BRCOND/BR pairs when necessary.
BRCONDTWOWAY,
+ // BR_CC - Conditional branch. The behavior is like that of SELECT_CC, in
+ // that the condition is represented as condition code, and two nodes to
+ // compare, rather than as a combined SetCC node. The operands in order are
+ // chain, cc, lhs, rhs, block to branch to if condition is true.
+ BR_CC,
+
+ // BRTWOWAY_CC - Two-way conditional branch. The operands in order are
+ // chain, cc, lhs, rhs, block to branch to if condition is true, block to
+ // branch to if condition is false. Targets usually do not implement this,
+ // preferring to have legalize demote the operation to BRCOND/BR pairs.
+ BRTWOWAY_CC,
+
// RET - Return from function. The first operand is the chain,
// and any subsequent operands are the return values for the
// function. This operation can have variable number of operands.
More information about the llvm-commits
mailing list