diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-06-09 18:55:00 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-06-09 18:55:00 +0000 |
commit | aebc3c1610f7ee563120ba5db7ae064d77af56c4 (patch) | |
tree | de03db94425aed6015525049580a51cd829edce6 /lib | |
parent | f1e2b23dfabb74249c2f1828dc902bd4bda52aa8 (diff) |
Add a check to make sure we don't crash with strange configurations where we do fast-isel, then try to fold instructions. PR10092.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132789 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/X86InstrInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index 18d71da474..f98497f654 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/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()) |