diff --git a/lib/Target/ARM/A15SDOptimizer.cpp b/lib/Target/ARM/A15SDOptimizer.cpp index 30b9c8071ba..f8a86a70c07 100644 --- a/lib/Target/ARM/A15SDOptimizer.cpp +++ b/lib/Target/ARM/A15SDOptimizer.cpp @@ -157,9 +157,8 @@ unsigned A15SDOptimizer::getPrefSPRLane(unsigned SReg) { MachineInstr *MI = MRI->getVRegDef(SReg); if (!MI) return ARM::ssub_0; MachineOperand *MO = MI->findRegisterDefOperand(SReg); - - assert(MO->isReg() && "Non-register operand found!"); if (!MO) return ARM::ssub_0; + assert(MO->isReg() && "Non-register operand found!"); if (MI->isCopy() && usesRegClass(MI->getOperand(1), &ARM::SPRRegClass)) {