mlir generated by cgeist is not valid to mlir-opt
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the command with linear-algebra/kernels/3mm/3mm.c, utilities/polybench.c, and the listed include paths, then inspect the cgeist output around the stderr global reported at line 18. Compare the generated IR with what mlir-opt accepts; done means the output parses and the shown lowering pipeline proceeds past the invalid memref element type.
Written by the indexing model from the issue text.
Description
Hi, I tried to convert polybench c to mlir through cgeist and lower to gpu dialect through mlir-opt, however, seems mlir generated by cgeist is invalid to mlir-opt, do you have any inputs? thanks.
error:
:18:73: error: invalid memref element type
llvm.mlir.global external @stderr() {addr_space = 0 : i32} : memref<?x!llvm.struct<(i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr<struct<()>>, ptr<struct<"struct._IO_FILE", (i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr<struct<"struct._IO_marker", opaque>>, ptr<struct<"struct._IO_FILE">>, i32, i32, i64, i16, i8, array<1 x i8>, ptr, i64, ptr<struct<"struct._IO_codecvt", opaque>>, ptr<struct<"struct._IO_wide_data", opaque>>, ptr<struct<"struct._IO_FILE">>, ptr, i64, i32, array<20 x i8>)>>, i32, i32, i64, i16, i8, array<1 x i8>, ptr, i64, ptr<struct<()>>, ptr<struct<()>>, ptr<struct<"struct._IO_FILE", (i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr<struct<"struct._IO_marker", opaque>>, ptr<struct<"struct._IO_FILE">>, i32, i32, i64, i16, i8, array<1 x i8>, ptr, i64, ptr<struct<"struct._IO_codecvt", opaque>>, ptr<struct<"struct._IO_wide_data", opaque>>, ptr<struct<"struct._IO_FILE">>, ptr, i64, i32, array<20 x i8>)>>, ptr, i64, i32, array<20 x i8>)>>
command:
cgeist -S linear-algebra/kernels/3mm/3mm.c -I utilities -I linear-algebra/kernels/atax utilities/polybench.c -I /dev/shm/test/Polygeist/llvm-project/build/lib/clang/16.0.0/include -DPOLYBENCH_TIME --raise-scf-to-affine | polygeist-opt --lower-affine | polygeist-opt --raise-scf-to-affine | mlir-opt --canonicalize -pass-pipeline="func.func(convert-affine-for-to-gpu{gpu-block-dims=1 gpu-thread-dims=0})" --lower-affine --convert-scf-to-cf --split-input-file --gpu-kernel-outlining --pass-pipeline="gpu.module(strip-debuginfo,convert-gpu-to-nvvm,gpu-to-cubin)" --gpu-to-llvm --lower-host-to-llvm | mlir-translate --mlir-to-llvmir
- Dominant language
- C++
- Stars
- 624
- Forks
- 170
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from llvm/Polygeist
-
How to preserve CUDA kernels in Polygeist GPU IR (polygeist.gpu_wrapper) instead of lowering to scf? Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
CUDA program to LLVM Open
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·