mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Eliminate the SetCCSDNode in favor of a CondCodeSDNode class. This pulls the
CC out of the SetCC operation, making SETCC a standard ternary operation and CC's a standard DAG leaf. This will make it possible for other node to use CC's as operands in the future... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22728 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -55,7 +55,7 @@ namespace ISD {
|
||||
|
||||
// Various leaf nodes.
|
||||
Constant, ConstantFP, GlobalAddress, FrameIndex, ConstantPool,
|
||||
BasicBlock, ExternalSymbol, VALUETYPE,
|
||||
BasicBlock, ExternalSymbol, VALUETYPE, CONDCODE,
|
||||
|
||||
// CopyToReg - This node has chain and child nodes, and an associated
|
||||
// register number. The instruction selector must guarantee that the value
|
||||
@ -107,9 +107,9 @@ namespace ISD {
|
||||
SELECT,
|
||||
|
||||
// SetCC operator - This evaluates to a boolean (i1) true value if the
|
||||
// condition is true. These nodes are instances of the
|
||||
// SetCCSDNode class, which contains the condition code as extra
|
||||
// state.
|
||||
// condition is true. The operands to this are the left and right operands
|
||||
// to compare (ops #0, and #1) and the condition code to compare them with
|
||||
// (op #2) as a CondCodeSDNode.
|
||||
SETCC,
|
||||
|
||||
// ADD_PARTS/SUB_PARTS - These operators take two logical operands which are
|
||||
@ -827,20 +827,20 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class SetCCSDNode : public SDNode {
|
||||
class CondCodeSDNode : public SDNode {
|
||||
ISD::CondCode Condition;
|
||||
protected:
|
||||
friend class SelectionDAG;
|
||||
SetCCSDNode(ISD::CondCode Cond, SDOperand LHS, SDOperand RHS)
|
||||
: SDNode(ISD::SETCC, LHS, RHS), Condition(Cond) {
|
||||
CondCodeSDNode(ISD::CondCode Cond)
|
||||
: SDNode(ISD::CONDCODE, MVT::Other), Condition(Cond) {
|
||||
}
|
||||
public:
|
||||
|
||||
ISD::CondCode getCondition() const { return Condition; }
|
||||
ISD::CondCode get() const { return Condition; }
|
||||
|
||||
static bool classof(const SetCCSDNode *) { return true; }
|
||||
static bool classof(const CondCodeSDNode *) { return true; }
|
||||
static bool classof(const SDNode *N) {
|
||||
return N->getOpcode() == ISD::SETCC;
|
||||
return N->getOpcode() == ISD::CONDCODE;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user