In some cases, e.g. ADD32ri, no transformation is made. Guide against it.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 7 Feb 2008 08:29:53 +0000 (08:29 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 7 Feb 2008 08:29:53 +0000 (08:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46849 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.cpp

index 1253631297ee77891084d79425bc4c5b606c0eec..18c5d2f8411c531794abaa9fe291934490109165 100644 (file)
@@ -1011,6 +1011,8 @@ X86InstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI,
   }
   }
 
+  if (!NewMI) return 0;
+
   NewMI->copyKillDeadInfo(MI);
   LV.instructionChanged(MI, NewMI);  // Update live variables
   MFI->insert(MBBI, NewMI);          // Insert the new inst