summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstrBundle.cpp
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2016-04-26 23:14:24 +0000
committerQuentin Colombet <qcolombet@apple.com>2016-04-26 23:14:24 +0000
commit3f192450151f4ed9eb656037193651781adf7d41 (patch)
tree95027b150ccd86a0c121a3f1e932196483d534bb /llvm/lib/CodeGen/MachineInstrBundle.cpp
parent053c2a6f25e48132d8f66bd73f3575da47cfde88 (diff)
downloadbcm5719-llvm-3f192450151f4ed9eb656037193651781adf7d41.tar.gz
bcm5719-llvm-3f192450151f4ed9eb656037193651781adf7d41.zip
[MachineInstrBundle] Improvement the recognition of dead definitions.
Now, it is possible to know that partial definitions are dead definitions and recognize that clobbered registers are also dead. llvm-svn: 267621
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstrBundle.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstrBundle.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineInstrBundle.cpp b/llvm/lib/CodeGen/MachineInstrBundle.cpp
index 4619daf3014..725237b5644 100644
--- a/llvm/lib/CodeGen/MachineInstrBundle.cpp
+++ b/llvm/lib/CodeGen/MachineInstrBundle.cpp
@@ -293,7 +293,7 @@ MachineOperandIteratorBase::PhysRegInfo
MachineOperandIteratorBase::analyzePhysReg(unsigned Reg,
const TargetRegisterInfo *TRI) {
bool AllDefsDead = true;
- PhysRegInfo PRI = {false, false, false, false, false, false, false};
+ PhysRegInfo PRI = {false, false, false, false, false, false, false, false};
assert(TargetRegisterInfo::isPhysicalRegister(Reg) &&
"analyzePhysReg not given a physical register!");
@@ -332,8 +332,12 @@ MachineOperandIteratorBase::analyzePhysReg(unsigned Reg,
}
}
- if (AllDefsDead && PRI.FullyDefined)
- PRI.DeadDef = true;
+ if (AllDefsDead) {
+ if (PRI.FullyDefined || PRI.Clobbered)
+ PRI.DeadDef = true;
+ else
+ PRI.PartialDeadDef = true;
+ }
return PRI;
}
OpenPOWER on IntegriCloud