diff options
author | Chris Lattner <sabre@nondot.org> | 2006-08-08 02:23:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-08-08 02:23:42 +0000 |
commit | c24a1d3093f3effd636d0e5d443c7eef5c7f3cee (patch) | |
tree | 19e92c5649877c7eaefe9c506bc6e71c15ed31b7 /llvm/utils/TableGen/DAGISelEmitter.cpp | |
parent | da2ace7117bffb5c3b0870b30fe4fa7512e000ac (diff) | |
download | bcm5719-llvm-c24a1d3093f3effd636d0e5d443c7eef5c7f3cee.tar.gz bcm5719-llvm-c24a1d3093f3effd636d0e5d443c7eef5c7f3cee.zip |
Start eliminating temporary vectors used to create DAG nodes. Instead, pass
in the start of an array and a count of operands where applicable. In many
cases, the number of operands is known, so this static array can be allocated
on the stack, avoiding the heap. In many other cases, a SmallVector can be
used, which has the same benefit in the common cases.
I updated a lot of code calling getNode that takes a vector, but ran out of
time. The rest of the code should be updated, and these methods should be
removed.
We should also do the same thing to eliminate the methods that take a
vector of MVT::ValueTypes.
It would be extra nice to convert the dagiselemitter to avoid creating vectors
for operands when calling getTargetNode.
llvm-svn: 29566
Diffstat (limited to 'llvm/utils/TableGen/DAGISelEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/DAGISelEmitter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp index f03c7c3b0da..8a887017c1e 100644 --- a/llvm/utils/TableGen/DAGISelEmitter.cpp +++ b/llvm/utils/TableGen/DAGISelEmitter.cpp @@ -2683,7 +2683,7 @@ public: } if (HasVarOps) - Code += ", Ops"; + Code += ", &Ops[0], Ops.size()"; else if (NodeHasOptInFlag) Code = "HasInFlag ? " + Code + ", InFlag) : " + Code; @@ -3420,7 +3420,8 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { << " std::vector<MVT::ValueType> VTs;\n" << " VTs.push_back(MVT::Other);\n" << " VTs.push_back(MVT::Flag);\n" - << " SDOperand New = CurDAG->getNode(ISD::INLINEASM, VTs, Ops);\n" + << " SDOperand New = CurDAG->getNode(ISD::INLINEASM, VTs, &Ops[0], " + "Ops.size());\n" << " ReplaceUses(SDOperand(N.Val, 0), New);\n" << " ReplaceUses(SDOperand(N.Val, 1), SDOperand(New.Val, 1));\n" << " Result = New.getValue(N.ResNo);\n" |