[all-commits] [llvm/llvm-project] d84a91: [AArch64][SVE] Avoid redundant extend of unsigned ...

Ricardo Jesus via All-commits all-commits at lists.llvm.org
Mon Nov 10 02:07:37 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d84a911e7e752e6337d1c0113818942b5b9350f5
      https://github.com/llvm/llvm-project/commit/d84a911e7e752e6337d1c0113818942b5b9350f5
  Author: Ricardo Jesus <rjj at nvidia.com>
  Date:   2025-11-10 (Mon, 10 Nov 2025)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
    M llvm/test/CodeGen/AArch64/sve-extract-element.ll

  Log Message:
  -----------
  [AArch64][SVE] Avoid redundant extend of unsigned i8/i16 extracts. (#165863)

Extracts of unsigned i8 or i16 elements from the bottom 128 bits of a
scalable register lead to the implied zero-extend being transformed to
an AND mask. The mask is redundant since UMOV already zeroes the high
bits of the destination register.

For example:
```c
int foo(svuint8_t x) {
  return x[3];
}
```
Currently:
```gas
foo:
  umov    w8, v0.b[3]
  and     w0, w8, #0xff
  ret
```
Becomes:
```gas
foo:
  umov    w0, v0.b[3]
  ret
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list