Skip to content

[WebAssembly] Degenerate case in vectorization of all true #144614

Open
@badumbatish

Description

@badumbatish

I'm investigating #50142, trying to reduce any_true to all_true , reproducible example code gives this godbolt:

#include <stdint.h>

int all_true(uint8_t *a) {
    int8_t r = 1;
    for (int i = 0 ; i < 16 ; i++) {
        r &= !!a[i];
    }
    return r;
}

I changed int8_t r = 1 to int8_t r= 0, and r &= !!a[i] to r |= !!a[i] and the code degenerates completely (not even vectorized as any_true or all_true).

The godbolt link is here

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions