[llvm] d397e29 - A15SDOptimizer::getPrefSPRLane - fix null dereference warning. NFCI
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 2 14:49:40 PDT 2019
Author: Simon Pilgrim
Date: 2019-11-02T21:49:12Z
New Revision: d397e29273ac5b05c2b6e382420310489e0f9d55
URL: https://github.com/llvm/llvm-project/commit/d397e29273ac5b05c2b6e382420310489e0f9d55
DIFF: https://github.com/llvm/llvm-project/commit/d397e29273ac5b05c2b6e382420310489e0f9d55.diff
LOG: A15SDOptimizer::getPrefSPRLane - fix null dereference warning. NFCI
Added:
Modified:
llvm/lib/Target/ARM/A15SDOptimizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/ARM/A15SDOptimizer.cpp b/llvm/lib/Target/ARM/A15SDOptimizer.cpp
index 30b9c8071ba2..f8a86a70c077 100644
--- a/llvm/lib/Target/ARM/A15SDOptimizer.cpp
+++ b/llvm/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)) {
More information about the llvm-commits
mailing list