CodeGen: Avoid dereferencing end() in MachineScheduler
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 11 Aug 2016 20:03:09 +0000 (20:03 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 11 Aug 2016 20:03:09 +0000 (20:03 +0000)
commit38eea4a76f015d6ee7afdb3a7a02ac6789104815
tree76d2c2a5a7363de797833256b510a5f65c71073b
parent9e4da07125504a0886fc7c224d233d317643d267
CodeGen: Avoid dereferencing end() in MachineScheduler

Check MachineInstr::isDebugValue for the same instruction as we're
calling isSchedBoundary, avoiding the possibility of dereferencing
end().

This is a functionality change even when I!=end().  Matthias had a look
and agrees this is the right resolution (as opposed to checking for
end()).

This is triggered by a huge number of tests, but they happen to
magically pass right now.  I found this because WIP patches for PR26753
convert them into crashes.

llvm-svn: 278394
llvm/lib/CodeGen/MachineScheduler.cpp