diff --git a/llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp b/llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp index 6f65e2203a60..05329211f522 100644 --- a/llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp +++ b/llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp @@ -349,7 +349,7 @@ void HexagonExpandCondsets::updateKillFlags(unsigned Reg) { // Set the flag on a use of Reg whose lane mask is contained in LM. MachineInstr *MI = LIS->getInstructionFromIndex(K); for (auto &Op : MI->operands()) { - if (!Op.isReg() || !Op.isUse() || Op.getReg() != Reg) + if (!Op.isReg() || !Op.readsReg() || Op.getReg() != Reg) continue; LaneBitmask SLM = getLaneMask(Reg, Op.getSubReg()); if ((SLM & LM) == SLM) {