summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-06-09 18:55:00 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-06-09 18:55:00 +0000
commitc095116710d06f632205c726fa15dbbe8f17e06c (patch)
tree0a3fb39ec201007d0f9bd5e76534a6676a6a87a4 /llvm/lib
parent68d6d8ab87c6593ff79d6cf125acda4d6c4456f8 (diff)
downloadbcm5719-llvm-c095116710d06f632205c726fa15dbbe8f17e06c.tar.gz
bcm5719-llvm-c095116710d06f632205c726fa15dbbe8f17e06c.zip
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
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86InstrInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp
index 18d71da4741..f98497f654b 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())
OpenPOWER on IntegriCloud