diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 |
commit | 71d5a2540a98c81f5bcaeb48805e0e2881f530ef (patch) | |
tree | 5343938942df402b49ec7300a1c25a2d4ccd5821 /lib/Target/Hexagon/RDFDeadCode.cpp | |
parent | 31bbf64f3a4974a2d6c8b3b27ad2f519caf74057 (diff) |
Diffstat (limited to 'lib/Target/Hexagon/RDFDeadCode.cpp')
-rw-r--r-- | lib/Target/Hexagon/RDFDeadCode.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Target/Hexagon/RDFDeadCode.cpp b/lib/Target/Hexagon/RDFDeadCode.cpp index 63177d51cada..9aa8ad68e07e 100644 --- a/lib/Target/Hexagon/RDFDeadCode.cpp +++ b/lib/Target/Hexagon/RDFDeadCode.cpp @@ -62,9 +62,19 @@ bool DeadCodeElimination::isLiveInstr(const MachineInstr *MI) const { return true; if (MI->isPHI()) return false; - for (auto &Op : MI->operands()) + for (auto &Op : MI->operands()) { if (Op.isReg() && MRI.isReserved(Op.getReg())) return true; + if (Op.isRegMask()) { + const uint32_t *BM = Op.getRegMask(); + for (unsigned R = 0, RN = DFG.getTRI().getNumRegs(); R != RN; ++R) { + if (BM[R/32] & (1u << (R%32))) + continue; + if (MRI.isReserved(R)) + return true; + } + } + } return false; } |