Skip to content

Fix TBAA metadata for loads/stores with negative indices - #9310

Merged
abadams merged 1 commit into
mainfrom
abadams/flipped_vector_reads_before_start
Aug 11, 2026
Merged

Fix TBAA metadata for loads/stores with negative indices#9310
abadams merged 1 commit into
mainfrom
abadams/flipped_vector_reads_before_start

Conversation

@abadams

@abadams abadams commented Aug 10, 2026

Copy link
Copy Markdown
Member

A predicated vector load with a negative stride is codegen'd as a dense load of the flipped ramp followed by a shuffle. If the load reaches the first element of the buffer, the flipped ramp starts before it, and the masked-off lanes give the ramp a negative base. add_tbaa_metadata asserted that the base was non-negative.

The TBAA tree describes power-of-two-sized blocks aligned relative to the start of the buffer, so it can't name a range that straddles the start. Emit metadata only down to the buffer level in that case.

Found while working on a fuzzer for sliding window schedules, but not actually related to sliding window.

A predicated vector load with a negative stride is codegen'd as a dense
load of the flipped ramp followed by a shuffle. If the load reaches the
first element of the buffer, the flipped ramp starts before it, and the
masked-off lanes give the ramp a negative base. add_tbaa_metadata
asserted that the base was non-negative.

The TBAA tree describes power-of-two-sized blocks aligned relative to
the start of the buffer, so it can't name a range that straddles the
start. Emit metadata only down to the buffer level in that case.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.75%. Comparing base (26c31e1) to head (b898931).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/CodeGen_LLVM.cpp 75.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9310      +/-   ##
==========================================
- Coverage   69.79%   69.75%   -0.04%     
==========================================
  Files         258      258              
  Lines       77956    77960       +4     
  Branches    18979    18980       +1     
==========================================
- Hits        54410    54383      -27     
+ Misses      17803    17795       -8     
- Partials     5743     5782      +39     

☔ 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.

@abadams
abadams merged commit 03a18bb into main Aug 11, 2026
28 checks passed
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