[llvm] [BOLT] Skip function instead of aborting on jump table analysis failure (PR #206742)

Rafael Auler via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 7 15:51:26 PDT 2026


================
@@ -789,7 +792,12 @@ void BinaryContext::populateJumpTables() {
           NextJTI->second->print(dbgs());
         }
       });
-      llvm_unreachable("jump table heuristic failure");
+      JT->EntriesAsAddress.clear();
+      JT->IsSplit = false;
+      // Keep JT in the map so it is still freed by ~BinaryContext.
+      for (BinaryFunction *Frag : JT->Parents)
+        addFragmentsToSkip(Frag);
----------------
rafaelauler wrote:

Instead of skipping this function with "addFragmentsToSkip", which is not intended for these cases and will cause a rather confusing error message in the output (skipped due to cold fragments), just Frag->setIgnored(true) straight away. You need to ignore these functions now at this point since we failed validation and at this point we have no guarantees we can correctly optimize this.

https://github.com/llvm/llvm-project/pull/206742


More information about the llvm-commits mailing list