[Hexagon] Do not fall-through if there is no CFG edge
[oota-llvm.git] / lib / Target / Hexagon / BitTracker.cpp
index 25ca44caf68e6a7d647ede75ef9496775dba4d47..23336b6546e2e46fd3fd7b307a8326ccfade0577 100644 (file)
@@ -1106,7 +1106,7 @@ void BT::run() {
     if (It == End) {
       MachineFunction::const_iterator BIt = B.getIterator();
       MachineFunction::const_iterator Next = std::next(BIt);
-      if (Next != MF.end()) {
+      if (Next != MF.end() && B.isSuccessor(Next)) {
         int ThisN = B.getNumber();
         int NextN = Next->getNumber();
         FlowQ.push(CFGEdge(ThisN, NextN));