aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-08-02 05:29:38 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-08-02 05:29:38 +0000
commit33d5595d667ba4a880bd7fe785724e8197bef70c (patch)
treed40ca1076c4bf7fcfeedd9b7f656c70b582b5c0e /lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
parent0a2a515c5bb075294dd261b0ad236b6d19c66f8c (diff)
Do not emit copies for physical register output if it's not used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAG.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index 3738702dc8..192b0767e3 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
@@ -676,7 +676,8 @@ void ScheduleDAG::EmitNode(SDNode *Node,
if (HasPhysRegOuts) {
for (unsigned i = II.numDefs; i < NumResults; ++i) {
unsigned Reg = II.ImplicitDefs[i - II.numDefs];
- EmitCopyFromReg(Node, i, Reg, VRBaseMap);
+ if (Node->hasAnyUseOfValue(i))
+ EmitCopyFromReg(Node, i, Reg, VRBaseMap);
}
}
} else {