Skip to content

fix(vmi): lower compact reduction stores with point stores - #1030

Merged
zhangstevenunity merged 1 commit into
hw-native-sys:mainfrom
mouliangyu:fix/vmi-compact-reduction-store
Jul 29, 2026
Merged

fix(vmi): lower compact reduction stores with point stores#1030
zhangstevenunity merged 1 commit into
hw-native-sys:mainfrom
mouliangyu:fix/vmi-compact-reduction-store

Conversation

@mouliangyu

Copy link
Copy Markdown
Collaborator

What

  • Normalize full-active continuous stores of compact vcadd/vcmax/vcmin results to unit-stride group_store.
  • Treat a full reduction as group = 1 when its only consumer is the store, allowing the existing group-slot lowering to emit 1PT_B32 directly.
  • Reuse the same path for explicit grouped reductions with 2, 4, or 8 compact results.
  • Preserve ordinary masked-store lowering when the store predicate is dynamic, since point stores cannot represent dynamic predication.

Why

A direct 1 x T -> 1 reduction followed by vstore previously lowered through neutral-init materialization, an extra vector add, predicate construction, and a masked store. The compact result can instead use the existing group-store representation and lower to vcadd plus 1PT_B32 store.

The layout regression test now uses memory-backed operands, allowing layout assignment to select a direct DINTLV_B32 load for multi-part widening/reduction flows instead of introducing an artificial conversion at a VMI register function argument.

Tests

  • cmake --build build-main-llvm21 --target pto-test-opt -j2
  • llvm-lit -sv build-main-llvm21/test/lit/vmi_new (438/438 passed)

Closes #1022.

The focused reproducer and performance context are in #1013.

@mouliangyu
mouliangyu marked this pull request as ready for review July 29, 2026 01:31
@zhangstevenunity
zhangstevenunity merged commit 456ebb4 into hw-native-sys:main Jul 29, 2026
11 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.

[VMI] Lower scalar reduce store to ONEPT without pad-8

2 participants