[all-commits] [llvm/llvm-project] 545cdc: [SCCP] Improve worklist management (#146321)

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Jun 30 08:17:52 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 545cdca4883552b147a0f1adfac713f76fc22305
      https://github.com/llvm/llvm-project/commit/545cdca4883552b147a0f1adfac713f76fc22305
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2025-06-30 (Mon, 30 Jun 2025)

  Changed paths:
    M llvm/lib/Transforms/Utils/SCCPSolver.cpp

  Log Message:
  -----------
  [SCCP] Improve worklist management (#146321)

SCCP currently stores instructions whose lattice value has changed in a
worklist, and then updates their users in the main loop. This may result
in instructions unnecessarily being visited multiple times (as an
instruction will often use multiple other instructions). Additionally,
we'd often redundantly visit instructions that were already visited when
the containing block first became executable.

Instead, change the worklist to directly store the instructions that
need to be revisited. Additionally, do not add instructions to the
worklist that will already be covered by the main basic block walk.

This change is conceptually NFC, but is expected to produce minor
differences in practice, because the visitation order interacts with the
range widening limit.



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