summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2009-08-16 17:40:59 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2009-08-16 17:40:59 +0000
commitf7e8af925cee687b94ed4b84235cf0efed75a68b (patch)
tree24b965d12249297bb6617a6b7262dd24403e6701 /lib/CodeGen/SelectionDAG
parent9ae7d44d95de16be5ed7bea7e1117160d9e2d5ce (diff)
downloadllvm-f7e8af925cee687b94ed4b84235cf0efed75a68b.tar.gz
llvm-f7e8af925cee687b94ed4b84235cf0efed75a68b.tar.bz2
llvm-f7e8af925cee687b94ed4b84235cf0efed75a68b.tar.xz
Be more clever about regclasses in ScheduleDAGSDNodes::EmitCopyFromReg.
If two uses of a CopyFromReg want different regclasses, first try a common sub-class, then fall back on the copy emitted in AddRegisterOperand. There is no need for an assert here. The cross-class joiner usually cleans up nicely. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79193 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp
index 12b5d143f8..17684f528a 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp
@@ -81,11 +81,11 @@ EmitCopyFromReg(SDNode *Node, unsigned ResNo, bool IsClone, bool IsCloned,
if (!UseRC)
UseRC = RC;
else if (RC) {
- if (UseRC->hasSuperClass(RC))
- UseRC = RC;
- else
- assert((UseRC == RC || RC->hasSuperClass(UseRC)) &&
- "Multiple uses expecting different register classes!");
+ const TargetRegisterClass *ComRC = getCommonSubClass(UseRC, RC);
+ // If multiple uses expect disjoint register classes, we emit
+ // copies in AddRegisterOperand.
+ if (ComRC)
+ UseRC = ComRC;
}
}
}