clover: Assertion `NumContainedTys && "Attempting to get element type of opaque pointer"' failed
System information
- OS: Ubuntu 21.10 impish
- Mesa version: 3dae5442
Describe the issue
Mesa Clover relying on Clang and libclc started to fail some days ago when building against LLVM main
branch. I bisected the LLVM tree and I noticed the error appeared with LLVM commit 702d5de4 which sets CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL
to ON
:
[Clang] Enable opaque pointers by default
Enable opaque pointers by default in clang, which can be disabled either via cc1 option -no-opaque-pointers or cmake flag -DCLANG_ENABLE_OPAQUE_POINTERS=OFF.
See https://llvm.org/docs/OpaquePointers.html for context.
Differential Revision: https://reviews.llvm.org/D123300
Starting with this commit, when running Luxmark 3.1 OpenCL benchmark, I get this crash:
luxmark.bin: …/include/llvm/IR/Type.h:381: llvm::Type *llvm::Type::getNonOpaquePointerElementType() const: Assertion `NumContainedTys && "Attempting to get element type of opaque pointer"' failed.
Regression
This is a regression, it works up to LLVM commit 69f7f156 (included).
This is broken by an LLVM change, but I don't know if the bug should be addressed in LLVM or in Mesa.
Edit: issue on LLVM side: https://github.com/llvm/llvm-project/issues/54970
Edit: I bisected the LLVM history by building 3dae5442 Mesa commit.