Skip to content

Remove unnecessary headers#5910

Merged
wujingyue merged 2 commits intomainfrom
wjy/include
Feb 3, 2026
Merged

Remove unnecessary headers#5910
wujingyue merged 2 commits intomainfrom
wjy/include

Conversation

@wujingyue
Copy link
Collaborator

No description provided.

@wujingyue
Copy link
Collaborator Author

!build

@wujingyue wujingyue requested a review from Priya2698 February 2, 2026 20:32
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 2, 2026

Greptile Overview

Greptile Summary

Removed unnecessary header includes from csrc/scheduler/utils.h by replacing ir/all_nodes.h and ir/cloner.h with the more specific ir/interface_nodes.h.

Analysis:

  • ir/all_nodes.h is a convenience header that transitively includes many IR node types (base_nodes.h, composite_nodes.h, interface_nodes.h, internal_base_nodes.h, internal_nodes.h, kernel_ir.h)
  • ir/cloner.h provides the IrCloner class, which is not used in utils.h
  • csrc/scheduler/utils.h only needs TensorView, IterDomain, and Fusion declarations, which are available through ir/interface_nodes.h

Impact:

  • Reduces compilation dependencies and speeds up incremental builds
  • Follows best practice of including only necessary headers
  • No functional changes to the API

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The change is a straightforward header cleanup that reduces unnecessary includes. The header file csrc/scheduler/utils.h only uses pointer declarations and forward declarations, so ir/interface_nodes.h provides all necessary types. The removed headers (ir/all_nodes.h and ir/cloner.h) were bringing in unnecessary transitive dependencies. This is a build hygiene improvement with no functional changes.
  • No files require special attention

Important Files Changed

Filename Overview
csrc/scheduler/utils.h replaced ir/all_nodes.h and ir/cloner.h with ir/interface_nodes.h, reducing unnecessary includes

Sequence Diagram

sequenceDiagram
    participant SU as csrc/scheduler/utils.h
    participant AN as ir/all_nodes.h (removed)
    participant CL as ir/cloner.h (removed)
    participant IN as ir/interface_nodes.h (added)
    participant BN as ir/base_nodes.h
    participant CN as ir/composite_nodes.h
    participant IBN as ir/internal_base_nodes.h
    participant INO as ir/internal_nodes.h
    participant KIR as kernel_ir.h

    Note over SU,IN: Before: utils.h included all_nodes.h + cloner.h
    SU->>AN: #include "ir/all_nodes.h"
    AN->>BN: includes base_nodes.h
    AN->>CN: includes composite_nodes.h
    AN->>IN: includes interface_nodes.h
    AN->>IBN: includes internal_base_nodes.h
    AN->>INO: includes internal_nodes.h
    AN->>KIR: includes kernel_ir.h
    SU->>CL: #include "ir/cloner.h"
    CL-->>SU: IrCloner definitions (unused)

    Note over SU,IN: After: utils.h only includes interface_nodes.h
    SU->>IN: #include "ir/interface_nodes.h"
    IN->>IBN: includes internal_base_nodes.h
    IN->>INO: includes internal_nodes.h
    Note over SU,IN: Reduced transitive includes:<br/>no base_nodes, composite_nodes, kernel_ir, cloner
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@wujingyue
Copy link
Collaborator Author

!build

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Description

  • Removed unnecessary header includes from scheduler/utils.h

  • Replaced "ir/all_nodes.h" and "ir/cloner.h" with "ir/interface_nodes.h"

  • Streamlined header dependencies to reduce compilation overhead

Changes walkthrough

Relevant files
Enhancement
utils.h
Streamline header includes in scheduler/utils.h                   

csrc/scheduler/utils.h

  • Removed includes for "ir/all_nodes.h" and "ir/cloner.h"
  • Added include for "ir/interface_nodes.h" as replacement
  • Streamlined header dependencies to improve compilation efficiency
  • +1/-2     

    PR Reviewer Guide

    Here are some key observations to aid the review process:

    🧪 No relevant tests
    ⚡ Recommended focus areas for review
    Header Replacement Verification

    The PR replaces two headers ("ir/all_nodes.h" and "ir/cloner.h") with "ir/interface_nodes.h". Need to verify that the new header provides all necessary functionality that was previously available through the removed headers. This should be validated by ensuring the code compiles successfully and all existing functionality in scheduler/utils.h continues to work as expected.

    #include "ir/interface_nodes.h"

    Copy link
    Contributor

    @greptile-apps greptile-apps bot left a comment

    Choose a reason for hiding this comment

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

    1 file reviewed, no comments

    Edit Code Review Agent Settings | Greptile

    @wujingyue wujingyue merged commit a221ab3 into main Feb 3, 2026
    14 of 15 checks passed
    @wujingyue wujingyue deleted the wjy/include branch February 3, 2026 06:08
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    None yet

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants