[llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Tue May 13 07:15:08 PDT 2025


================
@@ -2333,6 +2352,170 @@ DwarfDebug::emitInitialLocDirective(const MachineFunction &MF, unsigned CUID) {
   return PrologEndLoc;
 }
 
+void DwarfDebug::findKeyInstructions(const MachineFunction *MF) {
+  // New function - reset KeyInstructions.
+  KeyInstructions.clear();
+
+  // The current candidate is_stmt instructions for each source atom.
+  // Map {(InlinedAt, Group): (Rank, Instructions)}.
+  DenseMap<std::pair<DILocation *, uint32_t>,
+           std::pair<uint16_t, SmallVector<const MachineInstr *>>>
+      GroupCandidates;
----------------
jmorse wrote:

Welp, one or two is better than the default SmallVector calculation of "several"

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


More information about the llvm-commits mailing list