https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106329

            Bug ID: 106329
           Summary: No optimization for SVE pfalse predicate
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yyc1992 at gmail dot com
  Target Milestone: ---

If a known-all-false predicate is used on an SVE intrinsic, the result should
be fully no-op, undefined, zeroing and no actual instruction (other than
potentially returning a zero) should be generated. This does not seem to be
happening even when a `svpfalse_b()` is explicitly passed in as the predicate.

As an example,

```
svfloat64_t add(svfloat64_t a, svfloat64_t b)
{
    return svadd_x(svpfalse_b(), a, b);
}
```

is being compiled to
```
        pfalse  p0.b
        fadd    z0.d, p0/m, z0.d, z1.d
        ret
```

when it could simply be an empty function.

Reply via email to