Skip to content

Conversation

MathiasVP
Copy link
Contributor

We hit a performance problem on https://github.com/openvinotoolkit/oneDNN in the 2.23.0 release, and after looking long and hard at the resulting tuple count explosion in the IRGuards library I narrowed the problem down to a few InitializeParameter instructions with more than one enclosing IR functions.

Since each value number has an IRFunction column this meant that these InitializeParameter instructions mapped to many many value numbers which meant that certain joins in IRGuard which were expected to have no fan-out caused a large explosion.

Ideally, we should have no instruction with multiple enclosing IRFunctions. However, to mitigate this problem going forward this PR ensures that instructions with multiple IRFunctions are assigned a unique value number.

Commit-by-commit review recommended.

… The next commits will protect the recursion from instructions which has multiple IRFunctions and assign such instructions a unique value number so it won't make sense for them to have an IRFunction column.
…n instructions with a non-unique IRFUnction a unique value number.
@MathiasVP MathiasVP requested a review from a team as a code owner September 4, 2025 18:29
@Copilot Copilot AI review requested due to automatic review settings September 4, 2025 18:29
@github-actions github-actions bot added the C++ label Sep 4, 2025
@MathiasVP MathiasVP added the no-change-note-required This PR does not need a change note label Sep 4, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a performance issue in the value numbering library caused by instructions with multiple enclosing IR functions. The fix ensures that such instructions are assigned unique value numbers to prevent tuple count explosion in downstream analysis.

  • Modifies the value numbering system to handle instructions with multiple enclosing functions
  • Adds filtering logic to detect problematic instructions with multiple enclosing functions
  • Changes unique value number generation to be instruction-based rather than function-based

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant