[PowerPC] PPCVSXFMAMutate should not segfault on undef input registers
[oota-llvm.git] / lib / Target / PowerPC / PPCVSXFMAMutate.cpp
index 974857556dcb932a4f0867cd05970c42d742d08a..f392b2572bcda2135ecc8344a925599152d68df0 100644 (file)
@@ -103,6 +103,11 @@ protected:
 
         VNInfo *AddendValNo =
           LIS->getInterval(MI->getOperand(1).getReg()).Query(FMAIdx).valueIn();
+        if (!AddendValNo) {
+          // This can be null if the register is undef.
+          continue;
+        }
+
         MachineInstr *AddendMI = LIS->getInstructionFromIndex(AddendValNo->def);
 
         // The addend and this instruction must be in the same block.