DataStructures.jl icon indicating copy to clipboard operation
DataStructures.jl copied to clipboard

Package asserts when running tests on upcoming 1.6

Open KristofferC opened this issue 3 years ago • 2 comments

From PkgEval (https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/c3bb6df_vs_599ecd8/DataStructures.1.6.0-DEV-fe2d71bc7f.build-3d16cc1ee71b7eb9.log).

This is running with Julia and LLVM assertions on:

...
/home/pkgeval/.julia/packages/DataStructures/5hvIb/test/test_swiss_dict.jl ...
Intrinsic name not mangled correctly for type arguments! Should be: llvm.prefetch.p0i8
void (i8*, i32, i32, i32)* @llvm.prefetch
Intrinsic name not mangled correctly for type arguments! Should be: llvm.prefetch.p0i8
void (i8*, i32, i32, i32)* @llvm.prefetch
julia: /workspace/srcdir/deps/srccache/llvm-11.0.0/lib/Transforms/Vectorize/SLPVectorizer.cpp:2369: llvm::slpvectorizer::BoUpSLP::~BoUpSLP(): Assertion `!verifyFunction(*F, &dbgs())' failed.

signal (6): Aborted
in expression starting at /home/pkgeval/.julia/packages/DataStructures/5hvIb/test/test_swiss_dict.jl:14
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f547e991728)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_ZN4llvm13slpvectorizer7BoUpSLPD1Ev at /opt/julia/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm17SLPVectorizerPass7runImplERNS_8FunctionEPNS_15ScalarEvolutionEPNS_19TargetTransformInfoEPNS_17TargetLibraryInfoEPNS_9AAResultsEPNS_8LoopInfoEPNS_13DominatorTreeEPNS_15AssumptionCacheEPNS_12DemandedBitsEPNS_25OptimizationRemarkEmitterE.part.1510 at /opt/julia/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN12_GLOBAL__N_113SLPVectorizer13runOnFunctionERN4llvm8FunctionE at /opt/julia/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE at /opt/julia/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE at /opt/julia/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at /opt/julia/bin/../lib/julia/libLLVM-11jl.so (unknown line)
operator() at /workspace/srcdir/src/jitlayers.cpp:586
addModule at /workspace/srcdir/usr/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h:109 [inlined]
addModule at /workspace/srcdir/src/jitlayers.cpp:736
jl_add_to_ee at /workspace/srcdir/src/jitlayers.cpp:1036
jl_add_to_ee at /workspace/srcdir/src/jitlayers.cpp:1080
jl_add_to_ee at /workspace/srcdir/src/jitlayers.cpp:1065
jl_add_to_ee at /workspace/srcdir/src/jitlayers.cpp:1102 [inlined]
_jl_compile_codeinst at /workspace/srcdir/src/jitlayers.cpp:143
jl_generate_fptr at /workspace/srcdir/src/jitlayers.cpp:328
jl_compile_method_internal at /workspace/srcdir/src/gf.c:1924
jl_compile_method_internal at /workspace/srcdir/src/gf.c:2190 [inlined]
_jl_invoke at /workspace/srcdir/src/gf.c:2183 [inlined]
jl_apply_generic at /workspace/srcdir/src/gf.c:2373
jl_apply at /workspace/srcdir/src/julia.h:1693 [inlined]
do_call at /workspace/srcdir/src/interpreter.c:115
eval_value at /workspace/srcdir/src/interpreter.c:204
eval_stmt_value at /workspace/srcdir/src/interpreter.c:155 [inlined]
eval_body at /workspace/srcdir/src/interpreter.c:561

KristofferC avatar Nov 17 '20 15:11 KristofferC

cc @vtjnash @eulerkochy

oxinabox avatar Nov 17 '20 17:11 oxinabox

@oxinabox I also encounter this problem recently.On Julia-1.8.0-DEV, I fix this by changing the definition of prefetch from (on master):

@inline function _prefetchr(p::Ptr)
    ccall("llvm.prefetch", llvmcall, Cvoid, (Ref{Int8}, Int32, Int32, Int32), Ptr{Int8}(p), 0, 3, 1)
end

@inline function _prefetchw(p::Ptr)
    ccall("llvm.prefetch", llvmcall, Cvoid, (Ref{Int8}, Int32, Int32, Int32), Ptr{Int8}(p), 1, 3, 1)
end

to this:

@inline function _prefetchr(p::Ptr)
    ccall("llvm.prefetch.p0i8", llvmcall, Cvoid, (Ref{Int8}, Int32, Int32, Int32), Ptr{Int8}(p), 0, 3, 1)
end

@inline function _prefetchw(p::Ptr)
    ccall("llvm.prefetch.p0i8", llvmcall, Cvoid, (Ref{Int8}, Int32, Int32, Int32), Ptr{Int8}(p), 1, 3, 1)
end

It seems that newer version of llvm mangles intrinsic function with argument's type, so you can't just use a bare prefetch there. This fixes the test error on my local branch.

ChenNingCong avatar Aug 11 '22 01:08 ChenNingCong