From c095116710d06f632205c726fa15dbbe8f17e06c Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 9 Jun 2011 18:55:00 +0000 Subject: [PATCH] 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 --- llvm/lib/Target/X86/X86InstrInfo.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 18d71da47410..f98497f654b1 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -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())