[all-commits] [llvm/llvm-project] 09d944: [BOLT] Make ICF bucket iteration order determinist...

Kito Cheng via All-commits all-commits at lists.llvm.org
Wed Jul 1 01:04:39 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 09d944e919564eaaa2f9cb956c44e1d69549a182
      https://github.com/llvm/llvm-project/commit/09d944e919564eaaa2f9cb956c44e1d69549a182
  Author: Kito Cheng <kito.cheng at sifive.com>
  Date:   2026-07-01 (Wed, 01 Jul 2026)

  Changed paths:
    M bolt/lib/Passes/IdenticalCodeFolding.cpp
    M bolt/test/X86/icf-safe-icp.test
    M bolt/test/X86/icf-safe-test1.test
    M bolt/test/X86/icf-safe-test2GlobalConstPtrNoPic.test

  Log Message:
  -----------
  [BOLT] Make ICF bucket iteration order deterministic for single-threaded mode (#200706)

`CongruentBuckets` is an unordered_map, so iterating it directly
produces non-deterministic folding order across different build
environments. Sort buckets by the binary address of the representative
function before iterating to guarantee a stable debug output order.

That order isn't matter for the output binary, but it cause randomly
different debug output across different build environments, which makes
it hard to write stable tests for ICF.

Also the debug output of multi-threaded ICF is already non-deterministic
even we sort that by address, so we only try to stabilize the
single-threaded ICF output.

Update the icf-safe tests to reflect the new deterministic ordering.

Assisted-by: Sonnet 4.6



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