diff options
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; } |