Skip to content

Add short forms of Load::make and Store::make - #9247

Open
abadams wants to merge 3 commits into
abadams/remake_ir_nodesfrom
abadams/short_form_of_load_store_make
Open

Add short forms of Load::make and Store::make#9247
abadams wants to merge 3 commits into
abadams/remake_ir_nodesfrom
abadams/short_form_of_load_store_make

Conversation

@abadams

@abadams abadams commented Jul 28, 2026

Copy link
Copy Markdown
Member

Load::make and Store::make take a lot of arguments, most of which are empty or trivial for the many sites that construct an access to an internal buffer rather than deriving one from an existing node. Add three-argument overloads that supply the rest:

Load::make(type, name, index)
Store::make(name, value, index)

These use no image or parameter, an all-true predicate, a default-constructed ModulusRemainder, and is_streaming = false, which is exactly what the 57 converted call sites were already passing. The predicate is guaranteed equivalent by the lane-count assertions already in the long form.

Also removes the default argument for is_streaming from the long form of both. A trailing defaulted argument silently turns "I forgot this field" into "false", which is only safe as long as nobody uses make to rebuild an existing node. That has already gone wrong twice: the padding argument to Allocate::make was dropped when optimize_hexagon_instructions rebuilt an allocation, and is_streaming was dropped when StageStridedLoads was merged with the branch that introduced it. Neither was caught by a test. Now that Load::with and Store::with cover the rebuilding cases and the short forms cover the trivial ones, the long form only remains where the caller is constructing something specific, and can afford to say so.

The 27 sites that relied on the default now pass false explicitly. This preserves existing behavior everywhere, including the five places that synthesize a Load from a Store to analyze an atomic read-modify-write, which could propagate the Store's is_streaming but do not.

Load::make and Store::make take a lot of arguments, most of which are
empty or trivial for the many sites that construct an access to an
internal buffer rather than deriving one from an existing node. Add
three-argument overloads that supply the rest:

    Load::make(type, name, index)
    Store::make(name, value, index)

These use no image or parameter, an all-true predicate, a
default-constructed ModulusRemainder, and is_streaming = false, which is
exactly what the 57 converted call sites were already passing. The
predicate is guaranteed equivalent by the lane-count assertions already
in the long form.

Also removes the default argument for is_streaming from the long form of
both. A trailing defaulted argument silently turns "I forgot this field"
into "false", which is only safe as long as nobody uses make to rebuild
an existing node. That has already gone wrong twice: the padding argument
to Allocate::make was dropped when optimize_hexagon_instructions rebuilt
an allocation, and is_streaming was dropped when StageStridedLoads was
merged with the branch that introduced it. Neither was caught by a test.
Now that Load::with and Store::with cover the rebuilding cases and the
short forms cover the trivial ones, the long form only remains where the
caller is constructing something specific, and can afford to say so.

The 27 sites that relied on the default now pass false explicitly. This
preserves existing behavior everywhere, including the five places that
synthesize a Load from a Store to analyze an atomic read-modify-write,
which could propagate the Store's is_streaming but do not.

Co-Authored-By: Claude Opus 5 <[email protected]>
abadams and others added 2 commits July 28, 2026 12:41
IRGraphCXXPrinter emits C++ that reconstructs an IR graph, and static
asserts that the fields it extracts for each node match one of that
node's make() signatures. It was not extracting is_streaming for Load and
Store, which only compiled because make() defaulted that argument. Now
that the default is gone the assert fires, so extract it.

This also makes the printed reproducer faithful for streaming accesses,
which previously came back as non-streaming.

Co-Authored-By: Claude Opus 5 <[email protected]>
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.66667% with 16 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (abadams/remake_ir_nodes@7c86cd1). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/StorageFolding.cpp 42.10% 11 Missing ⚠️
src/CodeGen_D3D12Compute_Dev.cpp 0.00% 1 Missing ⚠️
src/CodeGen_OpenCL_Dev.cpp 0.00% 1 Missing ⚠️
src/HexagonOptimize.cpp 0.00% 1 Missing ⚠️
src/LowerWarpShuffles.cpp 0.00% 1 Missing ⚠️
src/Memoization.cpp 75.00% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##             abadams/remake_ir_nodes    #9247   +/-   ##
==========================================================
  Coverage                           ?   70.35%           
==========================================================
  Files                              ?      255           
  Lines                              ?    78677           
  Branches                           ?    18833           
==========================================================
  Hits                               ?    55352           
  Misses                             ?    17769           
  Partials                           ?     5556           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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