aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG
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
commit7df31dc89b0323bca5fd6aa0a72db4d663c9b8f3 (patch)
tree93b97fef17a1db81099e0d6cdf04ed19d70f819b /lib/CodeGen/SelectionDAG
parentcf4bb317efb48db2b68aebece255b71624dd5bce (diff)
downloadexternal_llvm-7df31dc89b0323bca5fd6aa0a72db4d663c9b8f3.zip
external_llvm-7df31dc89b0323bca5fd6aa0a72db4d663c9b8f3.tar.gz
external_llvm-7df31dc89b0323bca5fd6aa0a72db4d663c9b8f3.tar.bz2
Teach the dag scheduler to handle inline asm nodes with multi-value immediate operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41386 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAG.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index 192b076..11c69a4 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/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.