intel / intel/llvm

Generate different types for scalar and memory values

Open
#7,994 2 comments 0 reactions 1 assignee Claimed by @victor-eds View on GitHub
enhancement sycl-mlir
Dominant language
LLVM
Stars
1.5k
Forks
854
Avg merge
3d 17h
Merged PRs (30d)
137

Description

Currently, `cgeist` generates the same types for scalar and memory values, so compiling:

```cpp
class wrapper {
public:
explicit wrapper(bool b) : b{b} {}
private:
const bool b;
};

wrapper wrap(bool b) { return wrapper{b}; }
```

using `clang` results in a function signature like:

```llvm
define dso_local i8 @_Z4wrapb(i1 noundef zeroext %b)
```

whereas `cgeist` compiles to:

```llvm
define { i8 } @_Z4wrapb(i8 %0)
```

**Describe the solution you would like**

`cgeist` codegen should mimic `clang`'s in that aspect.

**Describe alternatives you have considered**

Handling this in a pass, but it would probably overcomplicate things and not save any time if a different codegen is used (it could already handle the problem).

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.