llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.87k stars 11.93k forks source link

[Clang] Bogus types when using __builtin_shufflevector on bool vectors #107981

Open philnik777 opened 1 month ago

philnik777 commented 1 month ago
using vec __attribute__((ext_vector_type(4))) = bool;

auto test() {
  return __builtin_shufflevector(vec{}, vec{}, 0, 1, 2, 3, 4, 5, 6, 7);
}

test() returns a __attribute__((__vector_size__(8 * sizeof(bool)))), which is obviously incorrect.

llvmbot commented 1 month ago

@llvm/issue-subscribers-clang-frontend

Author: Nikolas Klauser (philnik777)

```c++ using vec __attribute__((ext_vector_type(4))) = bool; auto test() { return __builtin_shufflevector(vec{}, vec{}, 0, 1, 2, 3, 4, 5, 6, 7); } ``` `test()` returns a `__attribute__((__vector_size__(8 * sizeof(bool))))`, which is obviously incorrect.