Skip to content

[Feature]: loops over popcount are really hard for static analysis #129

Backlog

Description

@pkhuong

Feature Description

Most vector instruction definitions loop over the constant number of lanes, and then look at the mask register if applicable.

Packed_Vector_Mem_Read? and Packed_Vector_Mem_Write? instead set the loop counter based on popcount, and that makes some static analysis tools really sad; similarly for COMPRESS_{m,z}.

Something like

    for i := 0 to elements-1 do
        if i < num_unmasked_elements then
            ... the same body ...
        endif;
    endfor;

might be friendlier?

Why Is This Needed?

Helps static analysers unroll the loops better when the bound is a trivial constant.

Activity

  1. added
    enhancement
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions