summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-25 00:53:07 +0000
committerChris Lattner <sabre@nondot.org>2007-08-25 00:53:07 +0000
commitdbfc4e4b07fa1760e00be3437ef916e56b38f419 (patch)
treea5697ab29e6cab020bafc63ee6b0a0adaad7ac97 /llvm/lib/CodeGen
parent48597b4ff85aa6aaa7cb14a8ec9e95c7a42b267c (diff)
downloadbcm5719-llvm-dbfc4e4b07fa1760e00be3437ef916e56b38f419.tar.gz
bcm5719-llvm-dbfc4e4b07fa1760e00be3437ef916e56b38f419.zip
Teach the dag scheduler to handle inline asm nodes with multi-value immediate operands.
llvm-svn: 41386
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index 192b0767e36..11c69a4e293 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
@@ -753,15 +753,16 @@ void ScheduleDAG::EmitNode(SDNode *Node,
}
break;
case 3: { // Immediate.
- assert(NumVals == 1 && "Unknown immediate value!");
- if (ConstantSDNode *CS=dyn_cast<ConstantSDNode>(Node->getOperand(i))){
- MI->addImmOperand(CS->getValue());
- } else {
- GlobalAddressSDNode *GA =
- cast<GlobalAddressSDNode>(Node->getOperand(i));
- MI->addGlobalAddressOperand(GA->getGlobal(), GA->getOffset());
+ for (; NumVals; --NumVals, ++i) {
+ if (ConstantSDNode *CS =
+ dyn_cast<ConstantSDNode>(Node->getOperand(i))) {
+ MI->addImmOperand(CS->getValue());
+ } else {
+ GlobalAddressSDNode *GA =
+ cast<GlobalAddressSDNode>(Node->getOperand(i));
+ MI->addGlobalAddressOperand(GA->getGlobal(), GA->getOffset());
+ }
}
- ++i;
break;
}
case 4: // Addressing mode.
OpenPOWER on IntegriCloud