Add a check to make sure we don't crash with strange configurations where we do fast-isel, then try to fold instructions. PR10092.

llvm-svn: 132789
This commit is contained in:
Eli Friedman 2011-06-09 18:55:00 +00:00
parent 68d6d8ab87
commit c095116710
1 changed files with 4 additions and 0 deletions

View File

@ -2392,6 +2392,10 @@ MachineInstr* X86InstrInfo::foldMemoryOperandImpl(MachineFunction &MF,
return 0;
}
// Conservatively fail out for loads without a memoperand.
if (LoadMI->memoperands_empty())
return 0;
// Determine the alignment of the load.
unsigned Alignment = 0;
if (LoadMI->hasOneMemOperand())