[llvm] [GlobalISel] Don't treat intrinsic callbr indirect dest as machine successor. (PR #221685)

Vikash Gupta via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 04:33:17 PDT 2026


================
@@ -240,18 +240,27 @@ bool InstructionSelectImpl::selectMachineFunction(MachineFunction &MF) {
   }
 
   for (MachineBasicBlock &MBB : MF) {
-    if (MBB.empty())
-      continue;
-
     if (!SelectedBlocks.contains(&MBB)) {
       // This is an unreachable block and therefore hasn't been selected, since
       // the main selection loop above uses a postorder block traversal.
       // We delete all the instructions in this block since it's unreachable.
       MBB.clear();
+
+      // Clearing dropped the terminators that encoded this block's successors,
----------------
vg0204 wrote:

So now if we drop all instructions (including terminator branching to SUCC) in MBB, we need to get rid of that stale SUCC!

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


More information about the llvm-commits mailing list