[all-commits] [llvm/llvm-project] 2c538d: [KeyInstr] Merge atoms in DILocation::getMergedLoc...

Orlando Cazalet-Hyams via All-commits all-commits at lists.llvm.org
Thu May 1 06:48:41 PDT 2025


  Branch: refs/heads/users/OCHyams/ki-llvm-merge
  Home:   https://github.com/llvm/llvm-project
  Commit: 2c538d7ba71f82c49800331d996316a96696aee2
      https://github.com/llvm/llvm-project/commit/2c538d7ba71f82c49800331d996316a96696aee2
  Author: Orlando Cazalet-Hyams <orlando.hyams at sony.com>
  Date:   2025-05-01 (Thu, 01 May 2025)

  Changed paths:
    M llvm/lib/IR/DebugInfoMetadata.cpp
    M llvm/unittests/IR/MetadataTest.cpp

  Log Message:
  -----------
  [KeyInstr] Merge atoms in DILocation::getMergedLocation

NFC for builds with LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS=OFF (default).

In an ideal world we would be able to track that the merged location is used in
multiple source atoms. We can't do this though, so instead we arbitrarily but
deterministically pick one.

In cases where the InlinedAt field is unchanged we keep the atom with the
lowest non-zero rank (highest precedence). If the ranks are equal we choose
the smaller non-zero group number (arbitrary choice).

In cases where the InlinedAt field is adjusted we generate a new atom group.
Keeping the group wouldn't make sense (a source atom is identified by the
group number and InlinedAt pair) but discarding the atom info could result
in missed is_stmts.

Add unittest in MetadataTest.cpp.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list