diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-04 08:35:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-04 08:35:21 +0000 |
commit | 3f97eb449b08069e3370d4ba7566c60bdbf0babd (patch) | |
tree | 984b83e589abfec0993b535162d885315d8e5c26 /include | |
parent | bc2e26241d507ecd6c79598e5175f90852b716b3 (diff) | |
download | llvm-3f97eb449b08069e3370d4ba7566c60bdbf0babd.tar.gz llvm-3f97eb449b08069e3370d4ba7566c60bdbf0babd.tar.bz2 llvm-3f97eb449b08069e3370d4ba7566c60bdbf0babd.tar.xz |
Introduce new UnarySDNode/BinarySDNode/TernarySDNode nodes, which coallocate
their operands with the node itself. This reduces malloc traffic for operand
lists. This reduces isel time on kc++ from 2.6164 to 2.5570s, about 2.3%.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33878 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 006bf6e8f2..b5a1e99396 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -995,6 +995,49 @@ inline bool SDOperand::hasOneUse() const { return Val->hasNUsesOfValue(1, ResNo); } +/// UnarySDNode - This class is used for single-operand SDNodes. This is solely +/// to allow co-allocation of node operands with the node itself. +class UnarySDNode : public SDNode { + virtual void ANCHOR(); // Out-of-line virtual method to give class a home. + SDOperand Op; +public: + UnarySDNode(unsigned Opc, SDVTList VTs, SDOperand X) + : SDNode(Opc, VTs), Op(X) { + InitOperands(&Op, 1); + } +}; + +/// BinarySDNode - This class is used for two-operand SDNodes. This is solely +/// to allow co-allocation of node operands with the node itself. +class BinarySDNode : public SDNode { + virtual void ANCHOR(); // Out-of-line virtual method to give class a home. + SDOperand Ops[2]; +public: + BinarySDNode(unsigned Opc, SDVTList VTs, SDOperand X, SDOperand Y) + : SDNode(Opc, VTs) { + Ops[0] = X; + Ops[1] = Y; + InitOperands(Ops, 2); + } +}; + +/// TernarySDNode - This class is used for three-operand SDNodes. This is solely +/// to allow co-allocation of node operands with the node itself. +class TernarySDNode : public SDNode { + virtual void ANCHOR(); // Out-of-line virtual method to give class a home. + SDOperand Ops[3]; +public: + TernarySDNode(unsigned Opc, SDVTList VTs, SDOperand X, SDOperand Y, + SDOperand Z) + : SDNode(Opc, VTs) { + Ops[0] = X; + Ops[1] = Y; + Ops[2] = Z; + InitOperands(Ops, 3); + } +}; + + /// HandleSDNode - This class is used to form a handle around another node that /// is persistant and is updated across invocations of replaceAllUsesWith on its /// operand. This node should be directly created by end-users and not added to |