[clang] [CIR] Implement lowering for BitInt that needs to be an array (PR #225470)

Kunal Dubey via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 23 00:22:16 PDT 2026


xakep8 wrote:

@erichkeane 
For powerpc64-unknown-linux-gnu, _BitInt(129) g = 1 lowers through CIR to [24 x i8] c"\01\00...", despite the module having a big-endian (E) data layout. Classic codegen emits c"\00...\01". CIR then loads the array as i192 and truncates it to i129, causing the value to become zero. The helper should order the extracted bytes according to the data layout’s endianness. Please add a PowerPC64 check covering both the global initializer and the subsequent i192 load/truncation.

```cpp
_BitInt(129) g = 1;

int g_is_one(void) {
  return g == 1;
}
```

https://github.com/llvm/llvm-project/pull/225470


More information about the cfe-commits mailing list