Skip to content

Mutual reductions not vectorized in SLP #55350

Open
@davemgreen

Description

@davemgreen

Given this code:
https://godbolt.org/z/G55n584nb

uint64_t both(uint32_t* x) {
    uint32_t s = 0;
    uint32_t m = 0;
    for(int i = 0; i < 32; i++) {
        s += x[i];
        m += x[i] * x[i];
    }
    return s + ((uint64_t)m << 32);
}

If we remove the s += line then it vectorizes the MLA. If we remove the m += line then it vectorizes the Add. But both together it does not.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions