llvm / llvm/llvm-project

LLDB SVE predicate variables displayed incorrectly

Open
#159,291 4 comments 0 reactions 0 assignees View on GitHub
backend:AArch64 lldb SVE
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

LLDB does not display SVE predicate variables (of type `svbool_t`) correctly:

1. Even with `DW_AT_bit_stride` set correctly for `svbool_t` (see #159285), LLDB reads 1 byte for an element of the predicate vector.
2. LLDB always reads 64 bits for a predicate vector implying vector length 512 bits.

For code

```C++
svbool_t pred16 = svwhilelt_b16_u32 (0u, 5u);
```

For VL = 512 bits:

```
(lldb) p/t *(uint64_t*)&pred16
(uint64_t) 0b0000000000000000000000000000000000000000000000000000000101010101
(lldb) p pred16
(bool __attribute__((ext_vector_type(8)))) (true, true, false, false, false, false, false, false)
```

For VL = 256 bits:

```
(lldb) p/t *(uint64_t*)&pred16
(uint64_t) 0b1010101010101010000001111011010000000000000000000000000101010101
(lldb) p pred16
(bool __attribute__((ext_vector_type(8)))) (true, true, false, false, true, true, true, true)
```

Notice that LLDB treats 1st byte `01010101` as `true` and then 2nd byte `00000001` as `true` while this was supposed to be several elements.

In the second example (for VL = 256 bits) LLDB reads memory beyond 32 bits of the predicate vector.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.