[all-commits] [llvm/llvm-project] 5619e1: Fix non-determinism in debuginfo (#68332)

Paul Kirth via All-commits all-commits at lists.llvm.org
Fri Oct 6 15:21:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5619e1b813f3fa7d67b7a85a177d72ccb5d709cb
      https://github.com/llvm/llvm-project/commit/5619e1b813f3fa7d67b7a85a177d72ccb5d709cb
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2023-10-06 (Fri, 06 Oct 2023)

  Changed paths:
    M llvm/include/llvm/IR/DebugInfo.h

  Log Message:
  -----------
  Fix non-determinism in debuginfo (#68332)

Assignment tracking iterates over a SmallSet when adding metadata, which
eventually results in debug metadata being added to the module in
non-deterministic order.

As reported in #63921, we saw some cases where DWARF DebugLoc entries
could have their order reversed, even though there was no functional
difference.

This patch replaces the `SmallSet` with a `SmallVector`, and adds the
required `DenseMapInfo` specialization to make the ordering
deterministic.

Fixes #63921




More information about the All-commits mailing list