diff options
author | Dan Gohman <gohman@apple.com> | 2009-10-30 23:57:47 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-10-30 23:57:47 +0000 |
commit | 4cddfd9b6f2b770c0dce66792b79ac9d18bb0ca3 (patch) | |
tree | 287a5d7b28e6f3253d12bd4e1405bc94e76faf7a | |
parent | 0437a06ea656d4ee954dec8a6233ed60d987e0c4 (diff) |
Don't mark registers dead here when processing nodes with MVT::Flag
results. This works around a problem affecting targets which rely on
MVT::Flag to handle physical register defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85638 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp index e727bc9f33..da311eddca 100644 --- a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp +++ b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp @@ -573,7 +573,11 @@ void InstrEmitter::EmitNode(SDNode *Node, bool IsClone, bool IsCloned, unsigned Reg = II.getImplicitDefs()[i - II.getNumDefs()]; if (Node->hasAnyUseOfValue(i)) EmitCopyFromReg(Node, i, IsClone, IsCloned, Reg, VRBaseMap); - else + // If there are no uses, mark the register as dead now, so that + // MachineLICM/Sink can see that it's dead. Don't do this if the + // node has a Flag value, for the benefit of targets still using + // Flag for values in physregs. + else if (Node->getValueType(Node->getNumValues()-1) != MVT::Flag) MI->addRegisterDead(Reg, TRI); } } |