Skip to content

[OpenMP][libomptarget] Error with OpenMPOpt / Attributor for Kokkos library #60788

Closed
llvm/llvm-project-release-prs
#311
@jplehr

Description

@jplehr

I ran into a failing assertion when compiling the Kokkos library release-candidate branch for their upcoming release 4.0 with trunk.
The Kokkos library is configured with CMake and the following flags (though the Kokkos_ARCH_ flag is changed manually in ccmake thereafter to GFX1030). The problem goes away if I set the openmp-opt-max-iterations to 1.

-D CMAKE_BUILD_TYPE=Release
    -D CMAKE_CXX_STANDARD=17
    -D CMAKE_CXX_EXTENSIONS=OFF
    -D CMAKE_INSTALL_PREFIX=$KOKKOS_INSTALL_DIR
    -D CMAKE_CXX_COMPILER=/path/to/llvm/clang++
    -D CMAKE_CXX_FLAGS="-mllvm -time-passes -mllvm -openmp-opt-max-iterations=20"
    -D CMAKE_VERBOSE_MAKEFILE=ON
    -D Kokkos_ARCH_NATIVE=ON
    -D Kokkos_ARCH_VEGA90A=ON
    -D Kokkos_ENABLE_OPENMP=ON
    -D Kokkos_ENABLE_OPENMPTARGET=ON
    -D Kokkos_ENABLE_COMPILER_WARNINGS=ON
    -D Kokkos_ENABLE_TESTS=ON

The assertion error I'm getting is

static llvm::Constant* llvm::ConstantInt::get(llvm::Type*, const llvm::APInt&): Assertion `C->getType() == Ty->getScalarType() && "ConstantInt type doesn't match the type implied by its value!"' failed.

I have attached an llvm-reduce'd .ll file that reproduces the error as well as the complete stack trace.
Let me know if more information is needed.

20230215-Kokkos-BuildError-trunk-stacktrace.txt
reduced.ll.txt

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions