`cgeist` always represents Boolean values using `i8`
- Dominant language
- LLVM
- Stars
- 1.5k
- Forks
- 854
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 137
Description
**Describe the bug**
`cgeist` always uses `i8` to represent Boolean values instead of using `i1`.
**To Reproduce**
Compile the following code:
```c
#include
bool or_test(bool a, bool b) {
return a || b;
}
```
Using:
```bash
cgeist %s -S -o - -function=*
```
The result is:
```mlir
func.func @or_test(%arg0: i8, %arg1: i8) -> i8 attributes {llvm.linkage = #llvm.linkage} {
%c0_i32 = arith.constant 0 : i32
%true = arith.constant true
%0 = arith.extui %arg0 : i8 to i32
%1 = arith.cmpi ne, %0, %c0_i32 : i32
%2 = scf.if %1 -> (i1) {
scf.yield %true : i1
} else {
%4 = arith.extui %arg1 : i8 to i32
%5 = arith.cmpi ne, %4, %c0_i32 : i32
scf.yield %5 : i1
}
%3 = arith.extui %2 : i1 to i8
return %3 : i8
}
```
When it should be:
```mlir
func.func @or_test(%arg0: i1, %arg1: i1) -> i1 attributes {llvm.linkage = #llvm.linkage} {
%0 = arith.ori %arg0, %arg1 : i1
return %0 : i1
}
```
**Environment (please complete the following information):**
- OS: Linux
- Target device and vendor: Intel CPU
- DPC++ version: `e6349c699222`
Contributor guide
Assessment
This issue has not been assessed yet.