[llvm] [CodeGen] Fix stale LiveIntervals regmask tables after MachineBasicBl… (PR #209610)

Nathan Corbyn via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 06:36:10 PDT 2026


================
@@ -281,11 +281,21 @@ class LiveIntervals {
     return Indexes->getMBBFromIndex(index);
   }
 
+  /// Add \p MBB to the SlotIndexes and regmask maps. \p MBB is expected to be a
+  /// fresh, empty basic block; it is recorded as having no regmask slots. To
+  /// split a block that already contains regmask-bearing instructions (e.g.
+  /// calls) into a new block, use splitAt() instead.
   void insertMBBInMaps(MachineBasicBlock *MBB) {
----------------
cofibrant wrote:

I'd prefer if we updated this with a default parameter `AssumeRegMaskEmpty = true`, drop the `insertMBBInMapsImpl` function and then only set `AssumeRegMaskEmpty = false` when calling from `spiltAt()`. This makes the whole thing feel much more robust to future call sites where we don't make this assumption.

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


More information about the llvm-commits mailing list