intel / llvm

Intel staging area for llvm.org contribution. Home for Intel LLVM-based projects.
Other
1.23k stars 736 forks source link

Assertion failed in `llvm/include/llvm/IR/Instructions.h` while building a SYCL application #10708

Closed fwyzard closed 4 weeks ago

fwyzard commented 1 year ago

Describe the bug

While building a SYCL application, clang/llvm aborts due to a failed assertion in llvm/include/llvm/IR/Instructions.h:

clang-17: /data/user/fwyzard/sycl/llvm/llvm/include/llvm/IR/Instructions.h:972: static llvm::GetElementPtrInst* llvm::GetElementPtrInst::Create(llvm::Type*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&, llvm::Instruction*): Assertion `cast<PointerType>(Ptr->getType()->getScalarType()) ->isOpaqueOrPointeeTypeMatches(PointeeType)' failed.

The full error message from the original compilation is attached: message.txt.

To Reproduce Please find attached a preprocessed file that reproduces the problem: gpuVertexFinder.ii.gz .

The failure can be reproduced with

gunzip gpuVertexFinder.ii.gz
clang++ -std=c++17 -O2 -fPIC -pipe -pthread -g -fsycl gpuVertexFinder.ii -o gpuVertexFinder.o

using the latest nightly.

The nightly itself was built with

python3 llvm/buildbot/configure.py --cmake-opt=-DCMAKE_INSTALL_PREFIX=/data/user/fwyzard/sycl/install/sycl-nightly/20230805_160000 -o /data/user/fwyzard/sycl/build/sycl-nightly/20230805_160000 --cmake-gen 'Unix Makefiles' --cuda --cmake-opt=-DCUDA_TOOLKIT_ROOT_DIR=/cvmfs/patatrack.cern.ch/externals/x86_64/rhel8/nvidia/cuda-11.8.0 --hip --hip-platform AMD --cmake-opt=-DSYCL_BUILD_PI_HIP_ROCM_DIR=/cvmfs/patatrack.cern.ch/externals/x86_64/rhel8/amd/rocm-5.4.0 --enable-all-llvm-targets --disable-fusion --shared-libs -t Release
make -C /data/user/fwyzard/sycl/build/sycl-nightly/20230805_160000 -j 24 all sycl-toolchain install

from the commit 8e0cc4b7a845df9389a1313a3e680babc4d87782 corresponding to the tag sycl-nightly/20230805_160000 .

The full build log is attached: build-sycl_nightly_20230805_160000.log.gz .

Environment (please complete the following information):

Additional context We suspect that the problem exists since some time; see an earlier report on our internal project here: https://github.com/AuroraPerego/pixeltrack-standalone/issues/6 .

The program compiles and runs successfully using oneAPI 2023.2.0, and older versions of the open source SYCL compiler.

fwyzard commented 1 year ago

@AuroraPerego @igorvorobtsov FYI

maarquitos14 commented 10 months ago

@fwyzard sorry for the delay. I have just tried to reproduce the issue and I'm getting a different issue than the one shown in message.txt. May I ask to try with the latest nightly and share the result? Thank you in advance!

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be automatically closed in 30 days.

fwyzard commented 4 weeks ago

@maarquitos14 thanks for your patience. I finally tried with the current nightly build, and the (original) file compiles without issues.