summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineSink.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-01-05 01:39:17 +0000
committerChris Lattner <sabre@nondot.org>2008-01-05 01:39:17 +0000
commit9bb459b55411c45175e599f6f421b7a57060ee57 (patch)
tree54fec129fe5809a42c76dfa1cfb759c94ea318c9 /lib/CodeGen/MachineSink.cpp
parent5a62d0a038b5e4032c88f2a794a91391738c5e90 (diff)
downloadllvm-9bb459b55411c45175e599f6f421b7a57060ee57.tar.gz
llvm-9bb459b55411c45175e599f6f421b7a57060ee57.tar.bz2
llvm-9bb459b55411c45175e599f6f421b7a57060ee57.tar.xz
fix a common crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineSink.cpp')
-rw-r--r--lib/CodeGen/MachineSink.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineSink.cpp b/lib/CodeGen/MachineSink.cpp
index 0665e87f67..dff60f6d39 100644
--- a/lib/CodeGen/MachineSink.cpp
+++ b/lib/CodeGen/MachineSink.cpp
@@ -180,6 +180,10 @@ bool MachineSinking::SinkInstruction(MachineInstr *MI) {
}
}
+ // If there are no outputs, it must have side-effects.
+ if (SuccToSinkTo == 0)
+ return false;
+
// FIXME: Check that the instr doesn't have side effects etc.
DEBUG(cerr << "Sink instr " << *MI);