Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal inttoptr in LinearAlgebra/bidiag #28464

Closed
Keno opened this issue Aug 6, 2018 · 1 comment · Fixed by #28465
Closed

Illegal inttoptr in LinearAlgebra/bidiag #28464

Keno opened this issue Aug 6, 2018 · 1 comment · Fixed by #28465

Comments

@Keno
Copy link
Member

Keno commented Aug 6, 2018

Only happens when when the test is run by itself:

$ ../julia runtests.jl LinearAlgebra/bidiag
Test             (Worker) | Time (s) | GC (s) | GC % | Alloc (MB) | RSS (MB)
Illegal inttoptr
	  %scevgep102103 = ptrtoint float addrspace(13)* %scevgep102 to i64
Illegal inttoptr
	  %scevgep105106 = ptrtoint float addrspace(13)* %scevgep105 to i64
Illegal inttoptr
	  %umax107108 = inttoptr i64 %umax to i8 addrspace(13)*
Illegal inttoptr
	  %umax109110 = inttoptr i64 %umax109 to { float, float } addrspace(13)*

signal (6): Aborted
in expression starting at /home/keno/julia/usr/share/julia/stdlib/v1.0/LinearAlgebra/test/bidiag.jl:13
__libc_signal_restore_set at /build/glibc-itYbWN/glibc-2.26/signal/../sysdeps/unix/sysv/linux/nptl-signals.h:80 [inlined]
raise at /build/glibc-itYbWN/glibc-2.26/signal/../sysdeps/unix/sysv/linux/raise.c:48
abort at /build/glibc-itYbWN/glibc-2.26/stdlib/abort.c:90
runOnFunction at /home/keno/julia/src/llvm-gc-invariant-verifier.cpp:178
_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE at /home/keno/julia/usr/bin/../lib/libLLVM-6.0.so (unknown line)
_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE at /home/keno/julia/usr/bin/../lib/libLLVM-6.0.so (unknown line)
_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at /home/keno/julia/usr/bin/../lib/libLLVM-6.0.so (unknown line)
operator() at /home/keno/julia/src/jitlayers.cpp:481
addModule at /home/keno/julia/usr/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h:57 [inlined]
addModule at /home/keno/julia/src/jitlayers.cpp:608
jl_add_to_ee at /home/keno/julia/src/jitlayers.cpp:855 [inlined]
@Keno
Copy link
Member Author

Keno commented Aug 6, 2018

bugpoint reduced:

; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "bugpoint-output-975f217.bc"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64-unknown-linux-gnu"

%jl_value_t = type opaque
%jl_array_t = type { i8 addrspace(13)*, i64, i16, i16, i32 }

define void @"japi1_\5C_38353"(%jl_value_t addrspace(10)**) #0 {
top:
  %1 = alloca { float, float }
  %2 = alloca { float, float }
  %3 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %0, i64 1
  %4 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %3, !nonnull !1, !dereferenceable !2, !align !2
  %5 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* null, i32 4
  %6 = bitcast %jl_value_t addrspace(10)* addrspace(11)* %5 to i64 addrspace(11)*
  %7 = load i64, i64 addrspace(11)* %6, !tbaa !3, !invariant.load !1
  %8 = xor i1 false, true
  %9 = select i1 %8, i64 %7, i64 0
  %10 = call %jl_value_t addrspace(10)* inttoptr (i64 140606041163008 to %jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, i64, i64)*)(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140605757498016 to %jl_value_t*) to %jl_value_t addrspace(10)*), i64 %9, i64 undef) [ "jl_roots"(i64 undef, i64 %9) ]
  %11 = addrspacecast %jl_value_t addrspace(10)* %4 to %jl_value_t addrspace(11)*
  %12 = bitcast %jl_value_t addrspace(11)* %11 to %jl_value_t addrspace(10)* addrspace(11)*
  %13 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* %12, !tbaa !6, !nonnull !1, !dereferenceable !10, !align !11
  br label %L107

L107:                                             ; preds = %L110, %top
  %value_phi7 = phi i64 [ 0, %top ], [ %48, %L110 ]
  %14 = icmp slt i64 %value_phi7, %9
  %15 = zext i1 %14 to i8
  %16 = trunc i8 %15 to i1
  %17 = xor i1 %16, true
  br i1 %17, label %L140, label %L110

L110:                                             ; preds = %L107
  %18 = add i64 %value_phi7, 1
  %19 = select i1 false, i64 1, i64 %18
  %20 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* null, i32 3
  %21 = bitcast %jl_value_t addrspace(10)* addrspace(11)* %20 to i64 addrspace(11)*
  %22 = load i64, i64 addrspace(11)* %21, !tbaa !3, !invariant.load !1
  %23 = mul i64 1, %22
  %24 = sub i64 %19, 1
  %25 = mul i64 %24, %23
  %26 = add i64 0, %25
  %27 = addrspacecast %jl_value_t addrspace(10)* %13 to %jl_value_t addrspace(11)*
  %28 = bitcast %jl_value_t addrspace(11)* %27 to %jl_array_t addrspace(11)*
  %29 = getelementptr inbounds %jl_array_t, %jl_array_t addrspace(11)* %28, i32 0, i32 0
  %30 = load i8 addrspace(13)*, i8 addrspace(13)* addrspace(11)* %29, !tbaa !3, !invariant.load !1, !nonnull !1
  %31 = bitcast i8 addrspace(13)* %30 to { float, float } addrspace(13)*
  %32 = getelementptr inbounds { float, float }, { float, float } addrspace(13)* %31, i64 %26
  %33 = load { float, float }, { float, float } addrspace(13)* %32, align 4, !tbaa !12
  store { float, float } %33, { float, float }* %1
  %34 = getelementptr inbounds { float, float }, { float, float }* %1, i32 0, i32 1
  %35 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
  %36 = load float, float* %34, align 4, !tbaa !14
  store float %36, float* %35, align 4, !tbaa !14
  %37 = sub i64 %18, 1
  %38 = mul i64 %37, 1
  %39 = add i64 0, %38
  %40 = add i64 %39, 0
  %41 = addrspacecast %jl_value_t addrspace(10)* %10 to %jl_value_t addrspace(11)*
  %42 = bitcast %jl_value_t addrspace(11)* %41 to %jl_array_t addrspace(11)*
  %43 = getelementptr inbounds %jl_array_t, %jl_array_t addrspace(11)* %42, i32 0, i32 0
  %44 = load i8 addrspace(13)*, i8 addrspace(13)* addrspace(11)* %43, !tbaa !3, !invariant.load !1, !nonnull !1
  %45 = load { float, float }, { float, float }* %2, align 4, !tbaa !14
  %46 = bitcast i8 addrspace(13)* %44 to { float, float } addrspace(13)*
  %47 = getelementptr inbounds { float, float }, { float, float } addrspace(13)* %46, i64 %40
  store { float, float } %45, { float, float } addrspace(13)* %47, align 4, !tbaa !12
  %48 = add i64 %value_phi7, 1
  br label %L107

L140:                                             ; preds = %L107
  ret void
}

attributes #0 = { "target-cpu"="skylake-avx512" "thunk" }

!llvm.module.flags = !{!0}

!0 = !{i32 1, !"Debug Info Version", i32 3}
!1 = !{}
!2 = !{i64 8}
!3 = !{!4, !4, i64 0, i64 1}
!4 = !{!"jtbaa_const", !5, i64 0}
!5 = !{!"jtbaa"}
!6 = !{!7, !7, i64 0}
!7 = !{!"jtbaa_immut", !8, i64 0}
!8 = !{!"jtbaa_value", !9, i64 0}
!9 = !{!"jtbaa_data", !5, i64 0}
!10 = !{i64 40}
!11 = !{i64 16}
!12 = !{!13, !13, i64 0}
!13 = !{!"jtbaa_arraybuf", !9, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"jtbaa_stack", !5, i64 0}

Keno added a commit that referenced this issue Aug 6, 2018
Pointers can have different types. For these, a simple bitcast
suffices rather than going through inttoptr.

Fixes #28464
Keno added a commit that referenced this issue Aug 6, 2018
Pointers can have different types. For these, a simple bitcast
suffices rather than going through inttoptr.

Fixes #28464
ararslan pushed a commit that referenced this issue Aug 6, 2018
Pointers can have different types. For these, a simple bitcast
suffices rather than going through inttoptr.

Fixes #28464

(cherry picked from commit 717ff90)
KristofferC pushed a commit that referenced this issue Feb 11, 2019
Pointers can have different types. For these, a simple bitcast
suffices rather than going through inttoptr.

Fixes #28464
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant