[llvm] [InstrRef][nfc] Remove usage of unique_ptrs of arrays (PR #74203)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 13:47:03 PST 2023


================
@@ -3503,7 +3504,10 @@ bool InstrRefBasedLDV::depthFirstVLocAndEmit(
   // Helper lambda for ejecting a block -- if nothing is going to use the block,
   // we can translate the variable location information into DBG_VALUEs and then
   // free all of InstrRefBasedLDV's data structures.
+  SmallPtrSet<const MachineBasicBlock *, 8> EjectedBBs;
   auto EjectBlock = [&](MachineBasicBlock &MBB) -> void {
+    if (EjectedBBs.insert(&MBB).second == false)
+      return;
----------------
jmorse wrote:

My recollection of this (which may be faulty) is that blocks should only get ejected once, in the order determined just above this block (it reduces the working-set size during compilation). If the added code fires I'd suggest there's a bug somewhere else, is there a reproducer for that? I'd imagine it'd only reduce performance a bit.

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


More information about the llvm-commits mailing list