[all-commits] [llvm/llvm-project] 024f39: [SCEV] Avoid redundant stack push/pop in createSCE...

Daemon via All-commits all-commits at lists.llvm.org
Thu Jun 11 11:32:53 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 024f39cbef647cd8ec196fd4d999b81f37d39e2d
      https://github.com/llvm/llvm-project/commit/024f39cbef647cd8ec196fd4d999b81f37d39e2d
  Author: Daemon <daemonpilot at hotmail.com>
  Date:   2026-06-11 (Thu, 11 Jun 2026)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp

  Log Message:
  -----------
  [SCEV] Avoid redundant stack push/pop in createSCEVIter (#199352)

This patch simplifies the iterative worklist handling in createSCEVIter.

In the previous implementation, a `Value` that could not be materialized
immediately would typically be pushed onto the stack twice and popped
twice: first in the initial unvisited state, and then again after being
re-queued in the visited state once its operands had to be processed
first.

This change avoids that redundant re-queue step by updating the existing
stack entry in place before pushing unresolved operands. Use
`setInt(true)` to update the existing `Stack` entry in place instead of
pushing a separate `(V, true)` entry. This saves one
`emplace_back`/`pop_back` pair for each `Value`, and reduces memory
consumption of the `Stack` worklist.



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