[llvm] [LLVM][GlobalISel] Support Blocks Created During Instruction Selection (PR #192625)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 09:19:49 PDT 2026


================
@@ -198,15 +197,46 @@ bool InstructionSelect::selectMachineFunction(MachineFunction &MF) {
     RAIIDelegateInstaller DelInstaller(MF, &AllObservers);
     ISel->AllObservers = &AllObservers;
 
-    for (MachineBasicBlock *MBB : post_order(&MF)) {
-      ISel->CurMBB = MBB;
-      SelectedBlocks.insert(MBB);
+    SmallVector<
+        std::pair<MachineBasicBlock *, MachineBasicBlock::succ_iterator>>
+        BlockSuccessorList;
+    DenseSet<MachineBasicBlock *> VisitedBlocks;
----------------
arsenm wrote:

I don't think storing a visited set is necessary, this is a matter of iterator management. Can you refer to how RegBankSelect achieves this? this should essentially be the same 

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


More information about the llvm-commits mailing list