llvm / llvm/Polygeist

opaque attribute handling issues

Open
#400 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
624
Forks
170
PR merge metrics
No merged PRs in 30d

Description

When a pointer to a structure is passed through a function parameter, the type of the pointer is incremented with the
opaque tag, which results in a compilation failure. The error message is as follows

`error: 'memref.get_global' op result type 'memref<1x!llvm.struct<"opaque@polygeist@mlir@struct.bit_stream_struc", (memref, i32, memref, ptr, i64, ptr, ptr, ptr, ptr, i64, i32, array<20 x i8>)>>, memref, i32, i64, i32, i32)>>' does not match type 'memref<1x!llvm.struct<"polygeist@mlir@struct.bit_stream_struc", (memref, i32, memref, ptr, i64, ptr, ptr, ptr, ptr, i64, i32, array<20 x i8>)>>, memref, i32, i64, i32, i32)>>' of the global memref @bs`

```
static Bit_stream_struc bs;
void lame_init_params(lame_global_flags *gfp)
{
...
init_bit_stream_w(&bs);
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the compilation failure with the provided C example involving the global Bit_stream_struc and init_bit_stream_w; trace opaque attribute handling for the pointer passed through the function parameter. Done means the generated global memref and function parameter types match without the opaque tag mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.