summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-16 05:49:56 +0000
committerChris Lattner <sabre@nondot.org>2006-05-16 05:49:56 +0000
commit5f0edfb849eca5a22693d5de9f24d200e5b905d5 (patch)
tree4b3922e21be65e0ab9049bd60ea32d4752883067 /llvm/lib/CodeGen
parent1f01aa0f2805d159f816d3b9df00222f95779c14 (diff)
downloadbcm5719-llvm-5f0edfb849eca5a22693d5de9f24d200e5b905d5.tar.gz
bcm5719-llvm-5f0edfb849eca5a22693d5de9f24d200e5b905d5.zip
Legalize FORMAL_ARGUMENTS nodes correctly, we don't want to legalize them once
for each argument. llvm-svn: 28313
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 650aaae7df8..f63a09248b8 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -819,9 +819,18 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
case ISD::FORMAL_ARGUMENTS:
// The only option for this is to custom lower it.
- Result = TLI.LowerOperation(Result, DAG);
+ Result = TLI.LowerOperation(Result.getValue(0), DAG);
assert(Result.Val && "Target didn't custom lower ISD::FORMAL_ARGUMENTS!");
- break;
+
+ // Since FORMAL_ARGUMENTS nodes produce multiple values, make sure to
+ // remember that we legalized all of them, so it doesn't get relegalized.
+ for (unsigned i = 0, e = Result.Val->getNumValues(); i != e; ++i) {
+ Tmp1 = LegalizeOp(Result.getValue(i));
+ if (Op.ResNo == i)
+ Tmp2 = Tmp1;
+ AddLegalizedOperand(SDOperand(Node, i), Tmp1);
+ }
+ return Tmp2;
case ISD::BUILD_VECTOR:
switch (TLI.getOperationAction(ISD::BUILD_VECTOR, Node->getValueType(0))) {
OpenPOWER on IntegriCloud